Let $C \subset \mathbb P^n$ be a variety in the projective $n$-space, which I define as the quotient $(\mathbb A^{n+1}\setminus\{0\}) / \sim$, with the equivalence relation $\sim$ on $\mathbb A^n$ identifying points that are scalar multiples of one another. For simplicity let us suppose that that the set $C$ is defined by a single polynomial equation $f(x_0, \cdots , x_n)=0$. Hartshorne (in section 1.5) defines a point $P \in \mathbb P^n$ to be a nonsingular point of $C$ if $\mathcal O_{P, Y}$ is a regular local ring. On the other hand, a direct generalization from the definition in affine cases suggests that $P$ should be a singular point if and only if $\frac{\mathcal \partial f}{\partial x_j} (P) = 0$ for all $0 \leq j \leq n$. I was curious whether it can be shown that these two definitions are equivalent. Basically what I ask is the following: is it possible to obtain a direct analogue of Hartshorne's Theorem 5.1 when $Y$ is an arbitrary variety or do I have to add some conditions to that end?
Edit: I am in particular looking for an answer to this for the example of the twisted cubic curve viewed as a subset of $\mathbb P^3$ (which Hartshorne defines in exercise 3.14).