Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waypoint::angle #268

Open
3 tasks
yakra opened this issue Feb 18, 2024 · 0 comments
Open
3 tasks

Waypoint::angle #268

yakra opened this issue Feb 18, 2024 · 0 comments

Comments

@yakra
Copy link
Owner

yakra commented Feb 18, 2024

return acos
( ( (x2-x1)*(x1-x0) + (y2-y1)*(y1-y0) + (z2-z1)*(z1-z0) )
/ sqrt ( ( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1) )
* ( (x1-x0)*(x1-x0) + (y1-y0)*(y1-y0) + (z1-z0)*(z1-z0) )
)
)
*180/pi;

  • Does saving & reusing the x/y/z deltas help, or does the compiler already optimize that away?
  • If I do make changes, make the indentation more readable.
    Otherwise, no-build because commit history.
  • If I'm really bored, see if there's a more efficient formula to calculate angle.
    Maybe something that doesn't have to find x/y/z and go from there?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant