Let A, B, C and D be four points in the plan. Then of the pair of angles ABC and ABD, determine which is larger.
C* D\ *\ABC/\ / ABD*-------------*B A
var compareAngle =var A = 2 0var B = 0 0var C = -1 2var D = 1 1console
npm install compare-angle
Compares the angles ABC and ABD to determine which is greater.
bare the base points of the angle
cis the end of the first angle
dis the end of the second angle
Returns A number indicating which angle is larger
+1if angle ABC is greater than angle ABD
0if the angles are equal
-1if angle ABD is greater than angle ABC
(c) 2014 Mikola Lysenko. MIT License