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

Function get_angle

Geometry/Half Plane Intersection Dynamic.cpp:46–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44double rad_to_deg(double r) { return (r * 180.0 / PI); }
45double deg_to_rad(double d) { return (d * PI / 180.0); }
46double get_angle(PT a, PT b) {
47 double costheta = dot(a, b) / a.norm() / b.norm();
48 return acos(max((double)-1.0, min((double)1.0, costheta)));
49}
50double cross2(PT a, PT b, PT c) { return cross(b - a, c - a); }
51// intersection point between ab and cd assuming unique intersection exists
52PT line_line_intersection(PT a, PT b, PT c, PT d) {

Callers

nothing calls this directly

Calls 2

dotFunction · 0.70
normMethod · 0.45

Tested by

no test coverage detected