Jump to content

How could I retrieve angle between two edges...?


Masoud

Recommended Posts

Hi;

In VEX, how could I retrieve angle between two edges that are connected to a specified point?

I tried these codes, but it shows 180 degrees instead of 135 ..!

int SelectedPoint = 1;
int SrcPoint = 0;
int DestPoint = 2;

vector pBasePos = point(0, "P", SelectedPoint);
vector pApos = point(0, "P", SrcPoint);
vector pBpos = point(0, "P", DestPoint);

vector VectorA = pBasePos - pApos ; 
vector VectorB = pBasePos - pBpos;

f@angle = degrees(acos(dot(VectorA,VectorB)));

Thanks.

Angle.JPG

Angles.hip

Edited by Masoud
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...