C# Class ThoNohT.NohBoard.Extra.Geom

A class containing geomitry related functionality.
Show file Open project: ThoNohT/NohBoard

Public Methods

Method Description
CircleToRectangle ( TPoint center, int radius ) : Rectangle

Converts the parameters for a circle to a rectangle containing the circle.

CircularTranslate ( this start, int distance, float angle ) : TPoint

Translates a point according the circular definition of a distance.

GetAngle ( this speed ) : float

Returns the angle in radians of a speed with two directional components.

GetLength ( this speed ) : float

Returns the length of a speed with two directional components.

RadToDeg ( float rad ) : float

Converts radians to degrees.

ToOrigin ( this rect ) : Rectangle

Returns a new rectangle that is translated to the origin.

Method Details

CircleToRectangle() public static method

Converts the parameters for a circle to a rectangle containing the circle.
public static CircleToRectangle ( TPoint center, int radius ) : Rectangle
center TPoint The center of the circle.
radius int The radius of the circle.
return System.Drawing.Rectangle

CircularTranslate() public static method

Translates a point according the circular definition of a distance.
public static CircularTranslate ( this start, int distance, float angle ) : TPoint
start this The point to translate.
distance int The distance to translate the point.
angle float The angle to translate the point at.
return TPoint

GetAngle() public static method

Returns the angle in radians of a speed with two directional components.
public static GetAngle ( this speed ) : float
speed this The speed.
return float

GetLength() public static method

Returns the length of a speed with two directional components.
public static GetLength ( this speed ) : float
speed this The speed.
return float

RadToDeg() public static method

Converts radians to degrees.
public static RadToDeg ( float rad ) : float
rad float The angle in radians.
return float

ToOrigin() public static method

Returns a new rectangle that is translated to the origin.
public static ToOrigin ( this rect ) : Rectangle
rect this The rectangle to translate.
return System.Drawing.Rectangle