简体   繁体   中英

How to get clockwise angle between 2 angle on unit circle

I think it's an easy trigonometric problem I have. According the following figures A and B :

Figures

What is the formula to get the clockwise angle between the two angle in the two situations?

Figure A: Point A (15°) Point B (45°) Angle: 330° Figure B: Point A (45°) Point B (135°) Angle: 90°

Thanks in advance

Simply A - B and then add or subtract 360 as needed.

Formula that works for all cases:

((A mod 360) - (B mod 360) + 720) mod 360

Edited: Add 720 instead of 360, in case A is negative and B is positive and you end up with less than -360.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM