User Guide

398 Chapter 3: ColdFusion Functions
Atn
Description
Arctangent function. The arctangent is the angle whose tangent is number.
Returns
The arctangent, in radians, of a number.
Category
Mathematical functions
Function syntax
Atn(number)
See also
Atn, Sin, ASin, Cos, ACos, Pi
Parameters
Usage
The range of the result is -π/2 to π/2 radians. To convert degrees to radians, multiply degrees by
π/180. To convert radians to degrees, multiply radians by 180/π.
Example
<h3>Atn Example</h3>
<!--- output its Atn value --->
<cfif IsDefined("FORM.AtnNum")>
<cfif IsNumeric(FORM.AtnNum)>
Atn(<cfoutput>#FORM.AtnNum#</cfoutput>) =
<cfoutput>#Atn(FORM.AtnNum)# radians =
#Evaluate(Atn(FORM.AtnNum * 180/PI())#
Degrees</cfoutput>
<cfelse>
<!--- if it is empty, output an error message --->
<h4>Enter a number</h4>
</cfif>
</cfif>
<form action = "atn.cfm">
<p>Enter a number to get its arctangent in Radians and Degrees
<br><input type = "Text" name = "atnNum" size = "25">
<p><input type = "Submit" name = ""> <input type = "RESET">
</form>
Parameter Description
number Tangent of an angle