HAPQF‖

8hVBJ‖Tan Function

juT9e‖Determines the tangent of an angle. The angle is specified in radians.

pWb7z‖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.

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

FVEx2‖Syntax:


PEoP9‖Tan (Number As Double) As Double

GePPP‖Return value:

Double

WADQ4‖Parameters:

5Wz2s‖ Number: Any numeric expression that you want to calculate the tangent for (in radians).

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

bAYDk‖degrees=(radians*180)/Pi

hDLbM‖radians=(degrees*Pi)/180

AEqBK‖Pi is approximately 3.141593.

SEjHR‖Error codes:

5 Invalid procedure call

EFSA4‖Example:


JFRRA‖' In this example, the following entry is possible for a right-angled triangle:
FQSGL‖' The side opposite the angle and the angle (in degrees) to calculate the length of the side adjacent to the angle:
Sub ExampleTangens
7CDv8‖' Pi = 3.1415926 is a pre-defined variable
Dim d1 As Double
Dim dAlpha As Double
vuUHo‖    d1 = InputBox("Enter the length of the side opposite the angle: ","opposite")
9GeDo‖    dAlpha = InputBox("Enter the Alpha angle (in degrees): ","Alpha")
aUvRq‖    Print "the length of the side adjacent the angle is"; (d1 / tan (dAlpha * Pi / 180))
End Sub