Some help with inverse sine (asin)

I am new to both the forum and know very little about c++. I am trying to write a program that will be menu driven and calculate the missing angles and side lengths of a triangle using the law of sines and also the law of cosines. I have some of the code working but the inverse sine (asin) is giving me a fit. I have attempted a bunch of different formulas in order to achieve the intended outcome. The code that I have now that has come the closest to the correct outcome is as follows.

1
2
3
angle2 = asin (side1 * (sin (angle1 * M_PI / 180)) / 81) * 180 / M_PI;
angle3 = 180 - angle1 - angle2;
side3 = side1 * (sin (angle3 * M_PI / 180)) / (sin (angle1 * M_PI / 180));

The user inputs the information from two of the sides and one angle and this should calculate the rest of the information. I know how to enter it into the calculator and that is about what I have here but I have to convert from radians to degrees.

The keystrokes for the TI83 are: sin-1(side1sin(angle1)/side2) if you should need to know.

I know that the code I have for the sin (side3) is correct because I have tested it and it already works. I just can't seem to get the asin part formatted correctly. I have searched the web and here but didn't find anything helpful.

All help is appreciated.

Kyle
Why do you divide by 81 ?
(side1 * (sin (angle1 * M_PI / 180)) / 81)
Thanks, a lot. I can't tell you how many times I overlooked that. It works fine now.
Topic archived. No new replies allowed.