| 10 | #include "vectorhulls.h" |
| 11 | |
| 12 | void VHRotateV(double *px, double *py, double ox, double oy, double theta) { |
| 13 | double tx, ty, ttx, tty; |
| 14 | |
| 15 | tx = *px - ox; |
| 16 | ty = *py - oy; |
| 17 | |
| 18 | // With not a lot of parts on the boards, we can get away with using the |
| 19 | // precision trig functions, might have to change to LUT based later. |
| 20 | ttx = tx * cos(theta) - ty * sin(theta); |
| 21 | tty = tx * sin(theta) + ty * cos(theta); |
| 22 | |
| 23 | *px = ttx + ox; |
| 24 | *py = tty + oy; |
| 25 | } |
| 26 | |
| 27 | ImVec2 VHRotateV(ImVec2 v, ImVec2 o, double theta) { |
| 28 | double tx, ty, ttx, tty; |
no outgoing calls
no test coverage detected