From WikiChip
Difference between revisions of "mirc/identifiers/$atan2"
< mirc‎ | identifiers

m
 
Line 1: Line 1:
 
{{mirc title|$atan2 Identifier}}'''$atan2''' returns the arctangent of the 2 short sides of a right triangle.
 
{{mirc title|$atan2 Identifier}}'''$atan2''' returns the arctangent of the 2 short sides of a right triangle.
 
 
 
== Synopsis ==
 
== Synopsis ==
 
<pre>$atan2(<O>,<A>)[.deg]</pre>
 
<pre>$atan2(<O>,<A>)[.deg]</pre>
 
 
== Parameters ==
 
== Parameters ==
 
<span style="display: inline-block; width: 50px;">'''O'''</span>The length of the Opposite side of the right triangle.<br />
 
<span style="display: inline-block; width: 50px;">'''O'''</span>The length of the Opposite side of the right triangle.<br />
 
<span style="display: inline-block; width: 50px;">'''A'''</span>The length of the Adjacent side of the right triangle.<br />
 
<span style="display: inline-block; width: 50px;">'''A'''</span>The length of the Adjacent side of the right triangle.<br />
 
 
== Properties ==
 
== Properties ==
 
<span style="display: inline-block; width: 80px;">'''.deg'''</span>Returns the angle as degrees, default is radians.
 
<span style="display: inline-block; width: 80px;">'''.deg'''</span>Returns the angle as degrees, default is radians.
 
 
== Example ==
 
== Example ==
<source lang="mIRC">//echo -a In right triangle where adjacent side is 3 and opposite side is 4, angle is $atan2( 3 , 4 ).deg degrees
+
<source lang="mIRC">//var %opposite 3, %adjacent 4 | echo -a In right triangle where opposite side is length %opposite and adjacent side is length %adjacent - angle is $atan2( %opposite , %adjacent ).deg degrees
; Returns: In right triangle where adjacent side is 3 and opposite side is 4, angle is 36.869898 degrees
+
; Returns: In right triangle where opposite side is length 3 and adjacent side is length 4 - angle is 36.869898 degrees
 
</source>
 
</source>
  
 
<source lang="mIRC">
 
<source lang="mIRC">
//var %opposite 3 | var %adjacent 4 | echo -a $atan2(%opposite,%adjacent) is the same as $atan( $calc( %opposite / %adjacent ) )
+
//var %opposite 4 | var %adjacent 3 | echo -a except for rounding $atan2(%opposite,%adjacent).deg is the same as $atan( $calc( %opposite / %adjacent ) ).deg
 
; ATAN2 accepts the side lengths while ATAN accepts the tangent ratio of those sides
 
; ATAN2 accepts the side lengths while ATAN accepts the tangent ratio of those sides
 
</source>
 
</source>
Line 24: Line 19:
 
== Compatibility ==
 
== Compatibility ==
 
{{mIRC compatibility|7.33}}
 
{{mIRC compatibility|7.33}}
 
 
== See also ==
 
== See also ==
 
* {{mIRC|$cos}}
 
* {{mIRC|$cos}}
Line 35: Line 29:
 
* {{mIRC|$atan}}
 
* {{mIRC|$atan}}
 
* {{mIRC|$tanh}}
 
* {{mIRC|$tanh}}
* [[List of identifiers - mIRC]]
 
{{mIRC identifier list}}
 
[[Category:mIRC identifiers|atan2]]
 

Latest revision as of 19:44, 27 December 2018

$atan2 returns the arctangent of the 2 short sides of a right triangle.

Synopsis[edit]

$atan2(<O>,<A>)[.deg]

Parameters[edit]

OThe length of the Opposite side of the right triangle.
AThe length of the Adjacent side of the right triangle.

Properties[edit]

.degReturns the angle as degrees, default is radians.

Example[edit]

//var %opposite 3, %adjacent 4 | echo -a In right triangle where opposite side is length %opposite and adjacent side is length %adjacent - angle is $atan2( %opposite , %adjacent ).deg degrees
; Returns: In right triangle where opposite side is length 3 and adjacent side is length 4 - angle is 36.869898 degrees
//var %opposite 4 | var %adjacent 3 | echo -a except for rounding $atan2(%opposite,%adjacent).deg is the same as $atan( $calc( %opposite / %adjacent ) ).deg
; ATAN2 accepts the side lengths while ATAN accepts the tangent ratio of those sides

Compatibility[edit]

Added: mIRC v7.33
Added on: 27 May 2014
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also[edit]