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

Function oriented_angle_on_sphere

Geometry/Geometry 3D.cpp:629–632  ·  view source on GitHub ↗

oriented angle between spherical segments ab and ac that is how much we rotate counterclockwise to get from ab to ac assume that the sphere is centered at the origin all points a, b, c are on the sphere

Source from the content-addressed store, hash-verified

627// assume that the sphere is centered at the origin
628// all points a, b, c are on the sphere
629double oriented_angle_on_sphere(p3 a, p3 b, p3 c) {
630 if ((a * b | c) >= 0) return angle_on_sphere(a, b, c);
631 else return 2 * PI - angle_on_sphere(a, b, c);
632}
633
634// Assume that the sphere is centered at the origin
635// the polygon is simple and given in counterclockwise order

Callers 1

Calls 1

angle_on_sphereFunction · 0.85

Tested by

no test coverage detected