C# Class GameMath.Angle

Show file Open project: npruehs/game-math

Public Methods

Method Description
Acos ( float x ) : float

Inverse of the cos function. Returns the angle whose cosine is the specified number, in radians.

Asin ( float x ) : float

Inverse of the sin function. Returns the angle whose sine is the specified number, in radians.

Atan ( float x ) : float

Inverse of the tan function. Returns the angle whose tangent is the specified number, in radians.

Atan2 ( float y, float x ) : float

Returns the angle whose tangent is the quotient of two specified numbers, in radians.

Between ( Vector2F v, Vector2F w ) : float

Returns the angle between the specified vectors in radians.

See http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm for details.

Cos ( float x ) : float

Returns the cosine of the specified angle in radians.

Cosh ( float x ) : float

Returns the hyperbolic cosine of the specified angle in radians.

DegreesToRadians ( float degrees ) : float

Converts the specified angle in degrees to radians.

Delta ( float x, float y ) : float

Shortest difference between the specified angles in radians. Think of this as "how do get from angle y to x". Example: Delta(3/2 Pi, 0) will return -1/2 Pi.

See http://stackoverflow.com/questions/1878907/the-smallest-difference-between-2-angles and http://stackoverflow.com/users/503402/max for details.

FromVector ( Vector2F v ) : float

Returns the angle between the specified vector and the x-axis. Example: FromVector(0.5, 0.5) will return DegreesToRadians(45).

See http://stackoverflow.com/questions/6247153/angle-from-2d-unit-vector for details.

RadiansToDegrees ( float degrees ) : float

Converts the specified angle in radians to degrees.

Sin ( float x ) : float

Returns the sine of the specified angle in radians.

Sinh ( float x ) : float

Returns the hyperbolic sine of the specified angle in radians.

Tan ( float x ) : float

Returns the tangent of the specified angle in radians.

Tanh ( float x ) : float

Returns the hyperbolic tangent of the specified angle in radians.

Method Details

Acos() public static method

Inverse of the cos function. Returns the angle whose cosine is the specified number, in radians.
public static Acos ( float x ) : float
x float Number to get the acos of.
return float

Asin() public static method

Inverse of the sin function. Returns the angle whose sine is the specified number, in radians.
public static Asin ( float x ) : float
x float Number to get the asin of.
return float

Atan() public static method

Inverse of the tan function. Returns the angle whose tangent is the specified number, in radians.
public static Atan ( float x ) : float
x float Number to get the atan of.
return float

Atan2() public static method

Returns the angle whose tangent is the quotient of two specified numbers, in radians.
public static Atan2 ( float y, float x ) : float
y float Dividend.
x float Divisor.
return float

Between() public static method

Returns the angle between the specified vectors in radians.
See http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm for details.
public static Between ( Vector2F v, Vector2F w ) : float
v Vector2F First vector.
w Vector2F Second vector.
return float

Cos() public static method

Returns the cosine of the specified angle in radians.
public static Cos ( float x ) : float
x float Angle to get the cosine of.
return float

Cosh() public static method

Returns the hyperbolic cosine of the specified angle in radians.
public static Cosh ( float x ) : float
x float Angle to get the hyperbolic cosine of.
return float

DegreesToRadians() public static method

Converts the specified angle in degrees to radians.
public static DegreesToRadians ( float degrees ) : float
degrees float /// Degrees to convert to radians. ///
return float

Delta() public static method

Shortest difference between the specified angles in radians. Think of this as "how do get from angle y to x". Example: Delta(3/2 Pi, 0) will return -1/2 Pi.
See http://stackoverflow.com/questions/1878907/the-smallest-difference-between-2-angles and http://stackoverflow.com/users/503402/max for details.
public static Delta ( float x, float y ) : float
x float First angle.
y float Second angle.
return float

FromVector() public static method

Returns the angle between the specified vector and the x-axis. Example: FromVector(0.5, 0.5) will return DegreesToRadians(45).
See http://stackoverflow.com/questions/6247153/angle-from-2d-unit-vector for details.
public static FromVector ( Vector2F v ) : float
v Vector2F Vector to get the angle of.
return float

RadiansToDegrees() public static method

Converts the specified angle in radians to degrees.
public static RadiansToDegrees ( float degrees ) : float
degrees float /// Radians to convert to degrees. ///
return float

Sin() public static method

Returns the sine of the specified angle in radians.
public static Sin ( float x ) : float
x float Angle to get the sine of.
return float

Sinh() public static method

Returns the hyperbolic sine of the specified angle in radians.
public static Sinh ( float x ) : float
x float Angle to get the hyperbolic sine of.
return float

Tan() public static method

Returns the tangent of the specified angle in radians.
public static Tan ( float x ) : float
x float Angle to get the tangent of.
return float

Tanh() public static method

Returns the hyperbolic tangent of the specified angle in radians.
public static Tanh ( float x ) : float
x float Angle to get the hyperbolic tangent of.
return float