How can I use Tangent on Visual basic?:(
Printable View
How can I use Tangent on Visual basic?:(
On my calculator, it has Tan(whatever) and also Tan-1(whatever). How can I get the Tan-1(whatever) in visual basic?
Tangent = Tan(Angle_in_Radians)
Arc_Tangent_Radians = Atn(Value)
Co_Tangent = 1 / Tangent
what does Arc_Tangent_Radians and Co_Tangent mean?
I havent learnt anything about this yet, I just started yesr 9 and my mum taught me What I know.
Tangent (angle) = the Ratio of the side Opposite the ange to the side Adjacent to the angle, in a right angled triangle
Arc Tangent(Value) (Often written as Tan to the power of -1) is the Angle who's ratio of the Opposite side to the Adjacent side is Value
Oh, I see, so arc tangent would be the Tan-1(whatever) on my calculator.
There's an easy way to remember:
SOHCAHTOA (pronounced "sock-a-toa")
Sin = Opposite / Hypotinuse
Cos = Adjecent / Hypotinuse
Tan = Opposite / Adjacent
Here's an example, Ctrl+G to open the debug window
Code:Const RAD2DEG As Double = "57.29577951308232" 'coercing a string to squeeze maximum accuracy
Dim Adj As Double, Opp As Double, Rat As Double, Rad As Double
Adj = 3 'Adjacent length
Opp = 4 'Opposite length
Rat = Opp / Adj 'Ratio of Opposite/Adjacent
Rad = Atn(Rat) 'Resulting angle in radians
Debug.Print "angle in Radians:"; Rad
Debug.Print "angle in Degrees:"; Rad * RAD2DEG
Debug.Print "Opposite length:"; Tan(Rad) * Adj
Debug.Print "Adjacent length:"; Opp / Tan(Rad)
On your calculator your have such as: Tan(pi/4) = 1 and Tan-1(1) = pi/4.
In VB or VBA, you can have : y = Tan(x) and x = Atn(y)
such as when you write : y = Tan(0.785390663375) then the value of y is 1 (nearly),
when you write : x = Atn(1) then the value of x is 0.785390663375 (~ pi/4)