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

(Created content for empty page)
 
 
(3 intermediate revisions by 2 users not shown)
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>$atan(<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">//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
<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
+
; Returns: In right triangle where opposite side is length 3 and adjacent side is length 4 - angle is 36.869898 degrees
; Returns: In right triangle where adjacent side is 3 and opposite side is 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>
  
 
== Compatibility ==
 
== Compatibility ==
{{mIRC compatibility|5.3}}
+
{{mIRC compatibility|7.33}}
 
+
== See also ==
== See Also ==
 
 
* {{mIRC|$cos}}
 
* {{mIRC|$cos}}
 
* {{mIRC|$acos}}
 
* {{mIRC|$acos}}
Line 36: Line 28:
 
* {{mIRC|$tan}}
 
* {{mIRC|$tan}}
 
* {{mIRC|$atan}}
 
* {{mIRC|$atan}}
* {{mIRC|$atan2}}
 
 
* {{mIRC|$tanh}}
 
* {{mIRC|$tanh}}
* [[List of identifiers - mIRC]]
 
{{mIRC identifier list}}
 

Latest revision as of 18: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]