hello
having position of 3 point i want to calculate the angle between them
If in 2D only, plot the 3 points on the same rectangular axes, so that you'd know how to get the angle between the two rays. For simplicity, put the corner of the angle on the origin (0,0).
Use the slopes of the rays. The slope of a line is the tangent of the angle made by the line with the horizontal axis, so the angle of the line with the horizontal axis is the arctangent of the slope.
So the angle between the two rays is actan(m1) minus arctan(m2).
Be careful with the signs of the slopes m1 and m2.
Hello, SuperEletcric!
Another approach . . .
Suppose the points are: .$\displaystyle A(x_1,y_1),\:B(x_2,y_2),\:C(x_3,y_3)$Having the positions of 3 points,
calculate the angles of the triangle.
Let's find angle $\displaystyle A \:=\:\angle BAC$
Use the Slope Formula to find: .$\displaystyle m_{_{AB}} \text{ and }m_{_{AC}}$
Then: .$\displaystyle \tan A \:=\:\left|\frac{m_{_{AB}} - m_{_{AC}}}{1 + m_{_{AB}}m_{_{AC}}}\right| $
Any three non-collinear points determine a triangle, even in $\displaystyle \Re^3$.
Hence we have three angles. If A, B, & C are the three points then $\displaystyle
m\left( {\angle ABC} \right) = \arccos \left( {\frac{{{\overrightarrow {BA} \cdot \overrightarrow {BC} } }}{{\left\| {\overrightarrow {BA} } \right\|\left\| {\overrightarrow {BC} } \right\|}}} \right)$.
This is exactly what TPH posted above.
The vector from $\displaystyle (a,b,c)$ to $\displaystyle (x,y,z)$ is found by subtracting the endpoints from the starting points:
$\displaystyle (x-a)\bold{i}+(y-b)\bold{j}+(z-c)\bold{k}$
The dot product, $\displaystyle (a\bold{i}+b\bold{j}+c\bold{k})\cdot (x\bold{i}+y\bold{j}+z\bold{k})=ax+by+cz$