Heya there!
For starters, I am somewhat new to Autoit, but I can still make a program or two....
However, recently I have tried to make a program which would solve basic Trigonometry problems (so I can give it as a parting gift to some of my friends )
This program is meant to work out the side measurements and angles of triangles in general, using the laws of sine. When I use the "Go" function in SciTe, there were no reported errors, so I compiled the file...
Ran the program, input the values (sufficient to solve for the rest), but an error comes up that one of the variables was not declared, even after I ran through the whole script numerous times....
(a copy of the script is available, in case the following does not work...)
;TRIG HELPER PROGRAM - SINE
;vars = x,y,z angX, angY,angZ
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Vars
$x = InputBox ("Trig Helper - Sine","input value of side 'x' (opposite angle X)"&@CRLF&"If there is no value, input 'x'")
$y = InputBox ("Trig Helper - Sine","input value of side 'y' (opposite angle Y)"&@CRLF&"If there is no value, input 'x'")
$z = InputBox ("Trig Helper - Sine","input value of side 'z' (opposite angle Z)"&@CRLF&"If there is no value, input 'x'")
$angX = InputBox ("Trig Helper - Sine","input value of angle 'X' (opposite side x)"&@CRLF&"If there is no value, input 'x'")
$angY = InputBox ("Trig Helper - Sine","input value of angle 'Y' (opposite side y)"&@CRLF&"If there is no value, input 'x'")
$angZ = InputBox ("Trig Helper - Sine","input value of angle 'Z' (opposite side z)"&@CRLF&"If there is no value, input 'x'")
;Vars end
MsgBox (1,"Trig Helper - Sine","The following info is what was input"&@CRLF&"side x = "&$x&" / "&"Angle X = "&$angX&@CRLF&"side y = "&$y&" / "&"Angle Y = "&$angY&@CRLF&"side z = "&$z&" / "&"Angle Z = "&$angZ)
;COMPUTATION SECTION
$pi = 3.14159265358979
$degToRad = $pi / 180
if $x = "x" Then
$valx1 = (($y * Sin ($angX * $degToRad)/Sin($angY * $degToRad)))
$valx2 = (($z * Sin ($angX * $degToRad)/Sin($angZ * $degToRad)))
EndIf
if $y = "x" Then
$valy1 = (($x * Sin ($angY * $degToRad)/Sin($angX * $degToRad)))
$valy2 = (($z * Sin ($angY * $degToRad)/Sin($angZ * $degToRad)))
EndIf
if $z = "x" Then
$valz1 = (($x * Sin ($angZ * $degToRad)/Sin($angX * $degToRad)))
$valz2 = (($y * Sin ($angZ * $degToRad)/Sin($angY * $degToRad)))
EndIf
;COMPUTATION SECTION END
MsgBox (1,"Trig Helper - Sine","The following has been solved"&@CRLF&"If there are two values for any side/angle, then the non-zero value is the correct one"&@CRLF&"side x = "&$valx1&" / "&$valx2&" /~\ "&"Angle X = "&$angX&@CRLF&"side y = "&$valy1&" / "&$valy2&" /~\ "&"Angle Y = "&$angY&@CRLF&"side z = "&$valz1&" / "&$valz2&" /~\ "&"Angle Z = "&$angZ)
Exit Trig helper - Sine ALT.au3