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>

Output

The tan of 0.5 is: 0.546302489844

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy