Siebel VB Language Reference > VB Language Reference >

Tan Function

This standard VB function returns the tangent of an angle in radians.





A numeric expression containing the number of radians in the angle whose tangent is to be returned


The tangent of number.


Number is specified in radians and can be either positive or negative.

The return value is single precision if the angle is an integer, currency, or single-precision value; double precision for a long, variant, or double-precision value.

To convert degrees to radians, multiply by PI/180. The value of PI is 3.14159.


This example finds the height of the exterior wall of a building, given its roof pitch and the length of the building.

Sub Button_Click
   Dim bldglen, wallht
   Dim pitch
   Dim msgtext
   Const PI = 3.14159
   Const conversion = PI/180
   On Error Resume Next
   pitch = 35
   pitch = pitch * conversion
   bldglen = 150
   wallht = Tan(pitch) * (bldglen/2)
End Sub

See Also

Atn Function
Cos Function
Sin Function
Derived Trigonometric Functions for Siebel VB

Siebel VB Language Reference