atan2

Summary

Gets an approximation of the arctangent of the quotient of the specified values.

Usage

public static double atan2(double y, double x)

Returns

The arctangent of the quotient of the specified values. The returned value will be between -π and π (inclusive) and is expressed in radians.

Parameters

y

The first value.

x

The second value.

Description

Returns an approximation of the arctangent of the quotient of the specified values (y/x), where the signs of the arguments y and x are used to determine the quadrant of the result.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
// Make sure you specify -0 (negative zero) as -0d. Non-floating
// point types do not have a "negative zero" value or concept.
Console.log(Math.atan2(0d, -0d) == Math.PI); // true
Console.log(Math.atan2(0d, +0d) == 0); // true

Share

HTML | BBCode | Direct Link