Angle Calculation Forumla Problem?
Posted: Fri Oct 16, 2020 5:21 pm
Hey everyone, I'm trying to write some scripts that can hit two points on the table and calculate the angle between those two points. I have most of the script worked out, but I'm having trouble with the "arc tangent" function.
I boiled down my script to a test of the "ATAN" function as you can see here:
#106=5
#108= atan 12 / 2
m225 #106 "atan is %f" #108
;Expected answer is: 1.4056
#108= atan 12 / 1
m225 #106 "atan is %f" #108
;Expected answer is: 1.4877
#108= atan 12 / .5
m225 #106 "atan is %f" #108
;Expected answer is: 1.5292
After each calculation is the answer I'd expect from doing each ATAN. The answers I actually get are off. It only seems to work the second example... Has anyone here had any experience with this?
I boiled down my script to a test of the "ATAN" function as you can see here:
#106=5
#108= atan 12 / 2
m225 #106 "atan is %f" #108
;Expected answer is: 1.4056
#108= atan 12 / 1
m225 #106 "atan is %f" #108
;Expected answer is: 1.4877
#108= atan 12 / .5
m225 #106 "atan is %f" #108
;Expected answer is: 1.5292
After each calculation is the answer I'd expect from doing each ATAN. The answers I actually get are off. It only seems to work the second example... Has anyone here had any experience with this?