diff --git a/lib/node_modules/@stdlib/math/base/special/atan2/README.md b/lib/node_modules/@stdlib/math/base/special/atan2/README.md index ae83ba4074a4..272391c18784 100755 --- a/lib/node_modules/@stdlib/math/base/special/atan2/README.md +++ b/lib/node_modules/@stdlib/math/base/special/atan2/README.md @@ -22,6 +22,22 @@ limitations under the License. > Compute the angle in the plane (in radians) between the positive x-axis and the ray from `(0,0)` to the point `(x,y)`. +
+ +The two-argument [arctangent][arctangent] function is defined as + + + +```math +\mathop{\mathrm{atan2}}(y, x) = \begin{cases} \arctan\!\left(\tfrac{y}{x}\right) & \textrm{if}\ x > 0 \\ \arctan\!\left(\tfrac{y}{x}\right) + \pi & \textrm{if}\ x < 0,\ y \geq 0 \\ \arctan\!\left(\tfrac{y}{x}\right) - \pi & \textrm{if}\ x < 0,\ y < 0 \\ +\tfrac{\pi}{2} & \textrm{if}\ x = 0,\ y > 0 \\ -\tfrac{\pi}{2} & \textrm{if}\ x = 0,\ y < 0 \end{cases} +``` + + + +
+ + +
## Usage @@ -35,19 +51,19 @@ var atan2 = require( '@stdlib/math/base/special/atan2' ); Computes the angle in the plane (in radians) between the positive x-axis and the ray from `(0,0)` to the point `(x,y)`. ```javascript -var v = atan2( 2.0, 2.0 ); // => atan(1.0) +var v = atan2( 2.0, 2.0 ); // returns ~0.785 -v = atan2( 6.0, 2.0 ); // => atan(3.0) +v = atan2( 6.0, 2.0 ); // returns ~1.249 -v = atan2( -1.0, -1.0 ); // => atan(1.0) - π +v = atan2( -1.0, -1.0 ); // returns ~-2.356 -v = atan2( 3.0, 0.0 ); // => π/2 +v = atan2( 3.0, 0.0 ); // returns ~1.571 -v = atan2( -2.0, 0.0 ); // => -π/2 +v = atan2( -2.0, 0.0 ); // returns ~-1.571 v = atan2( 0.0, 0.0 ); @@ -197,6 +213,8 @@ int main( void ) {