Calculating an Angle from $2$ points in space Given two points $p_1$ , $p_2$ around the origin $(0,0)$ in $2D$ space, how would you calculate the angle from $p_1$ to $p_2$?

How would this change in $3D$ space?
Assuming this is relative to the origin (as John pointed out): Given two position vectors $\vec p_1$ and $\vec p_2$, their dot product is:

$$\vec p_1\cdot \vec p_2 = |\vec p_1| \cdot |\vec p_2| \cdot \cos \theta$$

Solving for $\theta$, we get:

$$\theta = \arccos\left(\frac{\vec p_1 \cdot \vec p_2}{|\vec p_1| \cdot |\vec p_2|}\right)$$

In a 2D space this equals:

$$v = \arccos\left(\frac{x_1x_2 + y_1y_2}{\sqrt{(x_1^2+y_1^2) \cdot (x_2^2+y_2^2)}}\right)$$

And extended for 3D space:

$$v = \arccos\left(\frac{x_1x_2 + y_1y_2 + z_1z_2}{\sqrt{(x_1^2+y_1^2+z_1^2) \cdot (x_2^2+y_2^2+z_2^2)}}\right)$$
Let the two points be $(x_1,y_1)$ and $(x_2,y_2)$ then angle $\theta$ between them $=$
$$\theta=Tan^{-1}{\frac{y_2}{x_2}}-Tan^{-1}{\frac{y_1}{x_1}}$$