CFLib.org – Common Function Library Project

Cot(x)

Last updated October 9, 2001

Version: 1 | Requires: ColdFusion 5 | Library: MathLib

 
Rated 0 time(s). Average Rating: 0

Description:
Returns the Cotangent of an angle. If angle is 0, returns "undefined". All angles are expressed in radians.

Return Values:
Returns a numeric value or string.

Example:

view plain print about
<CFSET x=(Pi()/2)>
  <CFOUTPUT>
  Given x=1<BR>
  The cotangent of #x# radians is: #Cot(x)#.
  </CFOUTPUT>

Parameters:

Name Description Required
x Any angle in radians. Yes

Full UDF Source:

view plain print about
<cfscript>
/**
 * Returns the Cotangent of an angle.
 * 
 * @param x      Any angle in radians. 
 * @return Returns a numeric value or string. 
 * @author Rob Brooks-Bilson (rbils@amkor.com) 
 * @version 1, October 9, 2001 
 */

function Cot(x){
  if (x EQ 0)
    return "undefined";
  else 
    return 1/Tan(x);
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Dave Anderson Dave Anderson added
iniToStruct
20 day(s) ago

Dave Anderson Dave Anderson added
deDupeArray
20 day(s) ago

Richard Richard added
dice
22 day(s) ago

Isaac Dealey Isaac Dealey added
getRelative
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 22 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Raymond Camden highlightAndCrop
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson