The angles of a triangle(OAB) can be computed if the length of three sides are known using transformed version of cosine formula. Note that the angle between line L and OB is also needed to obtain actual angles of the segments.
Low of cosines
OAB =
Math.acos((OA * OA + AB * AB - BO * BO) /
(2 * OA * AB));
BOA =
Math.acos((OA * OA + BO * BO - AB * AB) /
(2 * OA * BO));
ABO =
Math.acos((AB * AB + BO * BO - OA * OA) /
(2 * BO* AB));
See 'Law of cosines - Wikipedia' for more about cosine formura.
sample movie and scripts



Leave a comment