I've been trying to write a Python script to solve triangles given various types of information but I'm having a bit of trouble with math.asin()... The section that ails me at present looks like this:
I can print B and it works just fine but the math.asin(sinB) part gives me a 'math domain error' and I have no idea why and there is a surprisingly small amount of documentation on the internet for this function. This is the exact error I'm getting:
. . .
A = math.radians(A)
sinB = (b*math.sin(A))/a
B = math.asin(sinB) #<---This is the part that screws me over.
Any help would be greatly appreciated.
Traceback (most recent call last):
File "./trisol.py", line 71, in <module>
File "./trisol.py", line 17, in parseArgs
File "./trisol.py", line 60, in ssa
B = math.asin(sinB)
ValueError: math domain error