Knowing the length of one side of a triangle and the ratio between the other two sides and the angle between the side I know the length of and one of the other sides, how do I calculate the length of that side?
If we call the angle opposite of b, beta and the angle opposite of c, gamma and split the triangle into two triangles by dropping a vertical from the beta angle straight down to the b face and call that new, common, vertical face x, then:
sin (gamma) = x / a
sin (alpha) = x / c
a = x / sin (gamma)
c = x / sin (alpha)
We know the ratio a / c and can cancel the unknown and unloved x to give
a / c = sin (alpha) / sin (gamma)
solve this for gamma and you now know all the internal angles (180 - alpha - gamma = beta)
Then use the law of sines to get c:
c / sin (gamma) = b / sin (beta)
c = b . sin (gamma) / sin (beta)
Hopefully I have not made any embarrassing mistakes… Be careful to be in radians as required.
Thank you so much for your reply!
So the expression should be
c = b * c / a * sin(alpha) / sin(180 - alpha - asin(c / a * sin (alpha)) ?
Looks about right, but I would suggest you work it out in steps like I did and check the angles look sane as you go.
Edit:
Care with that embedded 180 that your sin is using degrees and not radians
Yes, I did it the way you say but for some reason it didn’t work so i just wanted to try it this way.
If you can let me have the values you are using I’ll try it out here.
Omg, this saved me, I thought Vector3.Angle returns in radians, thank you so much, it finally works!
I’m glad you got the help you asked for but I’d like to add that this is in the physics forum. This kind of stuff is best posted in the scripting forum.
