Tan
Gets the tangent of a number
Syntax
`
Declare Function Tan ( ByVal number As Double ) As Double
`
Usage
`
result = Tan( number )
`
Parameters
`number`
the angle (in radians)
Return Value
Returns the tangent of the argument `number` as a `Double` within the range of -infinity to infinity.
Description
The argument `number` is measured in radians (not degrees). The required number argument can be any valid numeric expression. If `number` is an uninitialized variable, zero is returned.
Example
`
Const PI As Double = 3.1415926535897932
Dim a As Double
Dim r As Double
Input "Please enter an angle in degrees: ", a
r = a * PI / 180 'Convert the degrees to Radians
Print ""
Print "The tangent of a" ; a; " degree angle is"; Tan ( r )
Sleep
`
The output would look like:

    Please enter an angle in degrees: 75
    The tangent of a 75 degree angle Is 3.732050807568878

Differences from QB

- None

See also

- `Atn`
- `Atan2`
- A Brief Introduction To Trigonometry