Masoud Posted February 25, 2019 Share Posted February 25, 2019 (edited) 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. Angles.hip Edited February 25, 2019 by Masoud Quote Link to comment Share on other sites More sharing options...
anim Posted February 25, 2019 Share Posted February 25, 2019 normalize your vectors before doing dot() Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 25, 2019 Author Share Posted February 25, 2019 1 hour ago, anim said: normalize your vectors before doing dot() Thank you "anim". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.