FUNCTION:ACOS
last edited by
tbankert
on 09-Sep-2011
Contents |
ACos
Description
Arccosine function. The arccosine is the angle whose cosine is number.
Category
Mathematical
Implemented
Usage Syntax
ACos(number) The range of the result is 0 to p. To convert degrees to radians, multiply degrees by p/180. To convert radians to degrees, multiply radians by 180/p.
Return Information
| Return Type | Return Description |
| number | The arccosine, in radians, of a number. |
Arguments
| Name | Type | Required | Position | Default | Description |
| number | number | Yes | 1 | N/A | Cosine of an angle. The value must be between -1.0 and 1.0, inclusive. |
Example Usage
<h3>ACos Example</h3> <--- Output the arccosine value. ---> <cfif IsDefined("FORM.CosNum")> <cfif IsNumeric(FORM.CosNum)> <cfif Abs(FORM.CosNum) LESS THAN OR EQUAL TO 1> <cfoutput>ACos(#FORM.CosNum#) = #ACos(FORM.cosNum)# Radians </cfoutput> <br>or<br> <cfoutput>ACos(#FORM.CosNum#) = #ACos(FORM.cosNum) * 180/PI()#</cfoutput> <cfelse> <--- If it is empty, output an error message. ---> <h4>Enter a number between -1 and 1</h4> </cfif> </cfif> </cfif> <form method="post" action = "acos.cfm"> <p>Enter a number to get its arccosine in Radians and Degrees. <br><input type = "Text" name = "cosNum" size = "25"> <p><input type = "Submit" name = ""> <input type = "RESET"> </form>
SideBar
User Login