Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)

sin() : Sine Function

Calculate the sine of an angle (in radians).


On this page

Signature

sin(angleInRadians)

Parameters

Parameter Type Required Description
angleInRadians Number Yes The angle in radians

Returns

Type: Double

The sine of the angle (value between -1 and 1).


Examples

Basic Sine

<p>sin(Ï€/2) = {{format(sin(pi() / 2), '0.000')}}</p>

Output:

<p>sin(Ï€/2) = 1.000</p>

Convert Degrees to Radians First

<p>sin(30°) = {{format(sin(radians(30)), '0.000')}}</p>
<p>sin(45°) = {{format(sin(radians(45)), '0.000')}}</p>
<p>sin(90°) = {{format(sin(radians(90)), '0.000')}}</p>

Output:

<p>sin(30°) = 0.500</p>
<p>sin(45°) = 0.707</p>
<p>sin(90°) = 1.000</p>

Calculate Wave Position

<p>Y = {{format(model.amplitude * sin(model.angle), '0.00')}}</p>

Data:

doc.Params["model"] = new {
    amplitude = 10,
    angle = Math.PI / 4  // 45 degrees
};

Output:

<p>Y = 7.07</p>

Notes

  • Input must be in radians (not degrees)
  • Returns value between -1 and 1
  • For degrees, use: sin(radians(degrees))
  • Common values:
    • sin(0) = 0
    • sin(Ï€/6) = 0.5
    • sin(Ï€/4) ≈ 0.707
    • sin(Ï€/2) = 1

See Also