Tan Function

āĻāĻ•āϟāĻŋ āϕ⧋āύ⧇āϰ āĻŸā§‡āύāĻœā§‡āĻ¨ā§āϟ āύāĻŋāĻ°ā§āϧāĻžāϰāĻŖ āĻ•āϰāĻž āĻšā§ŸāĨ¤ āϕ⧋āύāϟāĻŋ āϰ⧇āĻĄāĻŋ⧟āĻžāύ⧇ āωāĻ˛ā§āϞ⧇āĻ– āĻ•āϰāĻž āĻšā§ŸāĨ¤

Using the angle Alpha, the Tan function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle.

Tan(Alpha) = side opposite the angle/side adjacent to angle

Syntax:


Tan (Number As Double) As Double

Return value:

Double

Parameters:

āϏāĻ‚āĻ–ā§āϝāĻž: āϝ⧇āϕ⧋āύ⧋ āϏāĻ‚āĻ–ā§āϝāĻžāϏ⧂āϚāĻ• āĻāĻ•ā§āϏāĻĒā§āϰ⧇āĻļāύ āϝāĻžāϰ āĻŸā§‡āύāĻœā§‡āĻ¨ā§āϟ āĻ—āĻŖāύāĻž āĻ•āϰāϤ⧇ āϚāĻžāύ (āϰ⧇āĻĄāĻŋ⧟āĻžāύ⧇)āĨ¤

To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi.

degrees=(radians*180)/Pi

radians=(degrees*Pi)/180

Pi is approximately 3.141593.

Error codes:

5 Invalid procedure call

Example:


REM āĻāχ āωāĻĻāĻžāĻšāϰāϪ⧇, āύāĻŋāĻšā§‡āϰ āĻāĻ¨ā§āĻŸā§āϰāĻŋāϟāĻŋ āϏāĻŽāϕ⧋āύ⧀ āĻ¤ā§āϰāĻŋāϭ⧁āĻœā§‡āϰ āϜāĻ¨ā§āϝ āϏāĻŽā§āĻ­āĻžāĻŦā§āϝ:
REM āϕ⧋āύ⧇āϰ āĻŦāĻŋāĻĒāϰ⧀āϤ āĻŦāĻžāĻšā§ āĻāĻŦāĻ‚ āϕ⧋āύ āϏāĻ‚āĻļā§āϞāĻŋāĻˇā§āϟ āĻŦāĻžāĻšā§āϰ āĻĻ⧈āĻ°ā§āĻ˜ā§āϝ āĻ—āĻŖāύāĻž āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āϕ⧋āύ (āĻĄāĻŋāĻ—ā§āϰāĻŋāϤ⧇):
Sub ExampleTangens
REM Pi = 3.1415926 āĻĒā§‚āĻ°ā§āĻŦāĻŋāύāĻŋāĻ°ā§āϧāĻžāϰāĻŋāϤ āϭ⧇āϰāĻŋā§Ÿā§‡āĻŦāϞ
Dim d1 As Double
Dim dAlpha As Double
    d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
    ddAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha")
    Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180))
End Sub

Please support us!