Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Fleck on August 28, 2015, 12:37:15 AM

Title: converting sine function, radians to degrees/solving triangle
Post 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
Title: Re: converting sine function, radians to degrees/solving triangle
Post by: Fleck on August 28, 2015, 02:03:56 AM
correction

 opposite = adjacent * (((Sin(angleOpposite) *180 / (4 * Atn(1) / (Sin(angleAdjacent)* 180 / (4 * Atn(1))))
Title: Re: converting sine function, radians to degrees/solving triangle
Post by: BR549 on August 28, 2015, 04:11:05 AM
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)