From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
function Sin(const Number Extended):Extended;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
The Sin function is a mathematical function giving the Sine value of a Number value given radians.<br>
function Sin(const X: Extended): Extended;
</div>


The Sin function is a mathematical function giving the Sine value of a number value given radians.<br>


'''Example:'''<br>
<b>Example</b><br>
:'''Base Syntax'''
<b>TRObject Syntax</b><br>
  const
<pre>
    PI = 3.14;
const
 
  PI = 3.14;
  var
    floatValue : float;
var
 
  floatValue : float;
  begin
 
{
    floatValue := '''Sin'''(PI/6);
    ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
  floatValue = Sin(PI/6);
 
  ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
  end;
}
</pre>
<b>Base Syntax</b><br>
<pre>
const
  PI = 3.14;
var
  floatValue : float;
begin
  floatValue := Sin(PI/6);
  ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
end;
</pre>


:'''TRObject Syntax'''
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
Sin(PI/6) =  0,499770102643102
</div>


  const
<h2> See Also </h2>
    PI = 3.14;
* [[System_Library#Math_Functions | Math Functions]]
 
  var
    floatValue : float;
 
  {
 
    floatValue = '''Sin'''(PI/6);
    ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
 
  }
 
'''Output:'''<br>
Sin(PI/6) =  0,499770102643102

Revision as of 12:44, 7 October 2024

The Sin function is a mathematical function giving the Sine value of a number value given radians.

Example
TRObject Syntax

 const
   PI = 3.14;
 
 var
   floatValue : float;
 
 {
 
   floatValue = Sin(PI/6);
   ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
 
 }

Base Syntax

 const
   PI = 3.14;
 
 var
   floatValue : float;
 
 begin
 
   floatValue := Sin(PI/6);
   ShowMessage('Sin(PI/6) = '+FloatToStr(floatValue));
 
 end;

Output:

See Also