User Guide Cancel

Tan

 

Description

Calculates the tangent of an angle that is entered in radians.

Returns

A number; the tangent of an angle.

Category

Mathematical functions

Function syntax

Tan(number)

See also

AtnCosACosSinASinPi

Parameters

Parameter

Description

number

Angle, in radians, for which to calculate the tangent.

Usage

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

Note: Because the function uses floating point arithmetic, it can return a small number (such as 6.12323399574E-017) for angles that must produce 0 and can return a large number (such as 1.63312393532E+016) for infinity or not a number. To test for a 0 value, check whether the value is less than 0.0000000000001. To test for an infinite value, check whether the value is more than 1E15.

Example

<cfscript>
val=0.5
writeOutput("The tan of " & val & " is: " & tan(val))
</cfscript>
<cfscript> val=0.5 writeOutput("The tan of " & val & " is: " & tan(val)) </cfscript>
<cfscript>
    val=0.5
    writeOutput("The tan of " & val & " is: " & tan(val))
</cfscript>

Output

The tan of 0.5 is: 0.546302489844

Get help faster and easier

New user?