MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / perp

Function perp

Geometry/Geometry 2D.cpp:44–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42inline double cross2(PT a, PT b, PT c) { return cross(b - a, c - a); }
43inline int orientation(PT a, PT b, PT c) { return sign(cross(b - a, c - a)); }
44PT perp(PT a) { return PT(-a.y, a.x); }
45PT rotateccw90(PT a) { return PT(-a.y, a.x); }
46PT rotatecw90(PT a) { return PT(a.y, -a.x); }
47PT rotateccw(PT a, double t) { return PT(a.x * cos(t) - a.y * sin(t), a.x * sin(t) + a.y * cos(t)); }

Callers 1

perpendicular_throughMethod · 0.70

Calls 1

PTClass · 0.70

Tested by

no test coverage detected