ACos

Description

Returns the arc cosine of a number, in radians. The arc cosine is the angle whose cosine is number.

Category

Mathematical functions

Syntax


ACos(number) 

See also

Cos, Sin, ASin, Tan, Pi

Parameters

Parameter
Description
number
Cosine of the angle to calculate. The 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/π.

Example

<!--- 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)>

    <cfif FORM.CosNum LESS THAN OR EQUAL TO 1>

      <cfif FORM.CosNum GREATER THAN OR EQUAL TO -1>

        ACos(<cfoutput>#FORM.CosNum#

        </cfoutput>) = <cfoutput>#ACos(FORM.cosNum)# Radians

        </cfoutput>

        <BR>

        or

        <BR>

        ACos(<cfoutput>#FORM.CosNum#</cfoutput>) = 

        <cfoutput>#Evaluate(ACos(FORM.cosNum) * 180/PI())# Degrees

        </cfoutput>

      <cfelse>

<!--- if it is empty, output an error message --->

      <H4>Please enter a number between -1 and 1</H4>

      </cfif>

    <cfelse>

<!--- if it is empty, output an error message --->

    <H4>Please enter a number between -1 and 1</H4>

    </cfif>

  </cfif>    

</cfif>



<form action = "acos.cfm" method = "POST">

<P>Type in 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>

</body>

</html> 



Banner.Novgorod.Ru