Sin

Description

Calculates the sine of an angle.

Return value

A number; the sine of the angle number.

Category

Mathematical functions

Syntax

Sin(number) 

See also

ASin, Atn, Cos, Pi, Tan

Parameters

Parameter Description
number
Angle, in radians.
To convert an angle from degrees to radians, use the PI function to multiply the degrees by pi/180.

Example

<h3>Sin Example</h3>

<!--- output its Sin value --->
<cfif IsDefined("FORM.SinNum")>
  <cfif IsNumeric(FORM.SinNum)>
    Sin(<cfoutput>#FORM.SinNum#</cfoutput>) = 
     <cfoutput>#Sin(FORM.sinNum)# Degrees = 
      #Evaluate(Sin(FORM.sinNum) * PI()/180)# Radians
     </cfoutput>
  <cfelse>
<!--- if it is empty, output an error message --->
    <h4>Please enter an angle for which you want the Sine value</h4>
  </cfif>
</cfif>

<form action = "sin.cfm">
<p>Type in a number to get its sine in Radians and Degrees
<br><input type = "Text" name = "sinNum" size = "25">
<p><input type = "Submit" name = ""> <input type = "RESET">
</form>

Comments