2
$\begingroup$

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:

enter image description here

$\endgroup$
  • $\begingroup$ We need more information. $\endgroup$ – Ali Caglayan Sep 1 '13 at 1:31
  • 1
    $\begingroup$ You only know two sides and no angle. This is not enough information to calculate that angle. $\endgroup$ – imranfat Sep 1 '13 at 1:31
  • $\begingroup$ What additional information do you need? $\endgroup$ – Shannon Hochkins Sep 1 '13 at 1:34
  • $\begingroup$ As I said I don't know! :( but what else do you need to calculate the angle? I'll see if I can get it @Alizter $\endgroup$ – Shannon Hochkins Sep 1 '13 at 1:34
  • $\begingroup$ What else do you need @imranfat? $\endgroup$ – Shannon Hochkins Sep 1 '13 at 1:39
4
$\begingroup$

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.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Wow, that's great! $\endgroup$ – Shannon Hochkins Sep 1 '13 at 1:59
  • $\begingroup$ so what would A/b be actually equal to? the end point of each side? $\endgroup$ – Shannon Hochkins Sep 1 '13 at 2:01
  • $\begingroup$ @ShannonHochkins - yes. A could be, say (1,2) And B would be say (2,1), both would have the same distance from the origin (0,0). $\endgroup$ – nbubis Sep 1 '13 at 2:04
  • $\begingroup$ Just to be clear here, those coordinates of the endpoints were NOT given in the question. And if these coordinates were, say A(4,1) and B(1,4), that angle would be different! $\endgroup$ – imranfat Sep 1 '13 at 3:18
  • $\begingroup$ @imranfat - I'm sure no one would have thought otherwise. That's the meaning of the word "say": this is just a particular example. $\endgroup$ – nbubis Sep 1 '13 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.