Spherical law of cosines help

Recommended Posts

I was attempting to build a type of link system using the law of cosines and discovered that I need to use the "spherical law of cosines" instead for calculating this "spherical triangle" as seen below.

I'm already pushing my limited math-in-Houdini skills and was hoping someone familiar with the concept could help me approach it in a good Houdini way to obtain the data/measurements needed to complete the solve for each angle in A B & C below.

In my use-case the simple image below represents a neutral position for three points.

Please note that the side measurements shown are NOT in radians ( simply distance from points) which would be a requirement to solve.

•Each point (A,B,C) is a fixed distance from the center of a sphere.  Essentially creating a spherical triangle.

•Each point only rotates about one axis between it and the center of the sphere creating angles

•The A point is in a fixed position on the sphere and does not move.  Consider it a kind of base point

•The C point travels, with a limited range along the surface of the sphere(essentially rotating it's position from the center if the sphere).

•The distance between  A & B (AB) and B & C (BC) are both fixed lengths and function as arms.

•The B point essentially functions as an elbow and always stays the same distance between both A & C respectively as the C point moves.

Essentially I need C to be driven by XYZ rotations from the center of the sphere and for B to "chase it" like a hinged elbow would "chase" a hand within the constraints of it's distance between A & C.

Using the Spherical Law of Cosines I should be able to measure the new distance of CA to find all the angles of A, B & C (in Radians?).

Essentially a simple inverse kinematic that avoids using the Houdini bone system.

Since A is always a fixed point I should the be able to simply compare the neutral angle of A to the new one and use that difference to drive the animation necessary to rotate both A and B to position the the BC and AB sides/arms to align with the C position as it travels along the suffice of the sphere.

I've included the scene below for reference but it's only a representation and the only potentially useful item is my measuring widget which unfortunately cannot do radians at this point.

Thanks for any help or pointers.

Michael

Law_of_cosines.hip