From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
function ArcTan(const Number Extended):Extended;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function ArcTan(const X: Extended): Extended;
</div>


The ArcTan function is a mathematical function giving the value in radians of the Arc Tangent of Number.<br>
Calculates the arctangent of a given number.<br>
In Clomosy code, ArcTan returns the arctangent of X.<br>
X is a real-type expression that gives an angle in radians.<br>


PI radians = 180 degrees
<b>Example</b><br>
<b>TRObject Syntax</b><br>
<pre>
var
  floatValue : single;
const
  PI = 3.14;
{
  // The ArcTan of PI/2 should give 1.0
  floatValue = ArcTan(PI/2);
  ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
  floatValue : single;
const
  PI = 3.14;
{
  // The ArcTan of PI/2 should give 1.0
  floatValue = ArcTan(PI/2);
  ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
}
</pre>


'''Example:'''<br>
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
ArcTan of PI/2 = 1,00365507798033
</div>


:'''TRObject Syntax'''
<h2> See Also </h2>
  var
* [[System_Library#Math_Functions | Math Functions]]
    floatValue : single;
 
  const
    PI = 3.14;
 
  {
    // The ArcTan of PI/2 should give 1.0
    floatValue = ArcTan(PI/2);
    ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
  }
 
:'''Base Syntax'''
  var
    floatValue : single;
 
  const
    PI = 3.14;
 
  begin
    // The ArcTan of PI/2 should give 1.0
    floatValue := ArcTan(PI/2);
    ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
  end;
 
'''Output:'''<br>
ArcTan of PI/2 = 1,00365507798033

Revision as of 10:23, 7 October 2024

Calculates the arctangent of a given number.
In Clomosy code, ArcTan returns the arctangent of X.
X is a real-type expression that gives an angle in radians.

Example
TRObject Syntax

var
   floatValue : single;
 
 const
   PI = 3.14;
 
 {
   // The ArcTan of PI/2 should give 1.0
   floatValue = ArcTan(PI/2);
   ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
 }

Base Syntax

 var
   floatValue : single;
 
 const
   PI = 3.14;
 
 {
   // The ArcTan of PI/2 should give 1.0
   floatValue = ArcTan(PI/2);
   ShowMessage('ArcTan of PI/2 = '+FloatToStr(floatValue));
 }

Output:

See Also