MCPcopy Create free account
hub / github.com/OpenBoardView/OpenBoardView / VHRotateV

Function VHRotateV

src/openboardview/vectorhulls.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "vectorhulls.h"
11
12void 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
27ImVec2 VHRotateV(ImVec2 v, ImVec2 o, double theta) {
28 double tx, ty, ttx, tty;

Callers 2

VHMBBCalculateFunction · 0.85
DrawPartsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected