C# Class Project290.Mathematics.RotationHelper

This static public class is used to convert from a Vector2 to an angle or vice versa.
Show file Open project: scastle/Solitude

Public Methods

Method Description
AngleToVector2 ( float angle ) : Vector2

Converts the specified angle into a vector of magnitude 1.

Vector2ToAngle ( float x, float y ) : float

Takes as a paramter a vector and returns the angle in radians corresponding to the vector.

Method Details

AngleToVector2() public static method

Converts the specified angle into a vector of magnitude 1.
public static AngleToVector2 ( float angle ) : Vector2
angle float The angle.
return Vector2

Vector2ToAngle() public static method

Takes as a paramter a vector and returns the angle in radians corresponding to the vector.
public static Vector2ToAngle ( float x, float y ) : float
x float The x coordinate.
y float The y cooordinate.
return float