If you’re going to try and paraphrase my post please at least link the full thing. You’re missing important information from it.
The labeled triangle image and the equations are references for solving the law of cosines. As stated in my thread:
We’ll be solving a 2 joint 2 limb system by adapting the Law of Cosines . For those unfamiliar the law allows us to take the lengths of a triangle and solve for its angles.
b = 1.255
a = 0.735
c = (shoulderPosition - goalPosition).magnitude
A = math.acos((-a^2 + b^2 - c^2) / (2 * b * c))
C = math.acos((a^2 + b^2 - c^2) / (2 * a * b))
This table of values corresponds to the variable used in the law of Cosines equations. You can put that triangle and its labels into the context of an arm by relating the following:
- Angle A is the angle of the shoulder
- Angle C is the angle of the elbow
- Vertex of angle A is the shoulder position
- Vertex of angle B is the goal position
- Length c is distance from the shoulder to the goal
- Length b is the length of the upper arm
- Length a is the length of the lower arm
The thread where I explain all of this does it in the context of an arm but it’s the same process with different joint names to translate it onto a leg. I’d really recommend reading over the thread and trying out the demo .rbxl file attached to the thread.