Get Tangent Method
The Get Tangent method returns the tangent of an angle in radians. You specify the value in the number argument in radians. This value can be positive or negative. To convert degrees to radians, this method multiplies degrees by PI/180. The value of PI is 3.14159.
For information on how this method handles the data type, see How Some Math Methods Handle the Data Type.
Format
Tan(number)
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
number |
A numeric expression that contains the number of radians in the angle whose tangent this method returns. |
Example
The following example finds the height of the exterior wall of a building, given the 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