I need to calculate the angle between two sides, I have the length of A & B sides, but don't know how to find the angle…
Both sides are the same length.
I can get the start and end vectors of each side, I can also get the center values of each side.
Here's an image better describing my question:
Best Answer
Assuming you have points: $$A=(A_x, A_y),\ B=(B_x,B_y)$$ And two equal sides with length $l$ originating from a shared point $O=(0,0)$, then the angle between $AO$ and $BO$ will be: $$\cos\theta = \frac{AO\cdot BO}{l^2}$$ $$\theta = \cos^{-1} \left(\frac{A_xB_x+A_yB_y}{l^2}\right)$$ This is just a particular case of the dot product.