Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Fleck on August 28, 2015, 12:37:15 AM
-
Trying to come up with working code to find length of opposite side of triangle. Works on calculator just cant get code correct.
What I have that is not working:
opposite = adjacent * (((Sin(angleOpposite) * Atn(X / Sqr(-X * X + 1) / (Sin(angleAdjacent)* Atn(X / Sqr(-X * X + 1)))
Any help is appreciated
-
correction
opposite = adjacent * (((Sin(angleOpposite) *180 / (4 * Atn(1) / (Sin(angleAdjacent)* 180 / (4 * Atn(1))))
-
I have no idea IF your formula is correct BUT this makes the script run. Youshould be able to work it out from there.
angleAdjacent = 90
angleOpposite = 120
opposite2 = (angleadjacent * Sin(angleOpposite) *180) / (4 * Atn(1)) / (Sin(angleAdjacent)* 180) / (4 * Atn(1))
MsgBox ("" & opposite2)