Acos - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

252

ACos

Returns the arccosine of a number in radians. The arccosine is the angle whose cosine
is number.
See also Cos, Sin, ASin,
Syntax
ACos( number )
number
Cosine of the angle that is to be calculated. This value must be between -1 and 1,
inclusive.
Usage
The range of the result is 0 to .
To convert degrees to radians, multiply degrees by /180. To convert radians to
degrees, multiply radians by 180/ .
Examples
<!--- This example shows how to use ACos --->
<HTML>
<HEAD>
<TITLE>ACos Example</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>ACos Example</H3>
<!--- output its arccosine value --->
<CFIF IsDefined("FORM.CosNum")>
<CFIF IsNumeric(FORM.CosNum)>
<CFOUTPUT>#ACos(FORM.cosNum)# Radians</CFOUTPUT>
<CFOUTPUT>#Evaluate(ACos(FORM.cosNum) * 180/PI())# Degrees</CFOUTPUT>
<!--- if it is empty, output an error message --->
<!--- if it is empty, output an error message --->
</CFIF>
Tan,
and Pi.
<CFIF FORM.CosNum LESS THAN OR EQUAL TO 1>
<CFIF FORM.CosNum GREATER THAN OR EQUAL TO -1>
ACos(<CFOUTPUT>#FORM.CosNum#</CFOUTPUT>) =
<BR>
or
<BR>
ACos(<CFOUTPUT>#FORM.CosNum#</CFOUTPUT>) =
<CFELSE>
<H4>Please enter a number between -1 and 1</H4>
</CFIF>
<CFELSE>
<H4>Please enter a number between -1 and 1</H4>
</CFIF>
CFML Language Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents