C# Class Strilanc.Angle.Basis

Mostra file Open project: Strilanc/Angle Class Usage Examples

Public Properties

Property Type Description
Natural Basis

Public Methods

Method Description
AngleToDir ( double angle ) : Dir

Returns the direction corresponding to the given angle in this basis.

AngleToTurn ( double angle ) : Turn

Returns the turn corresponding to a rotation by the given angle in this basis.

DirToSignedAngle ( Dir direction ) : double

Returns the smallest positive or negative angle corresponding to the given direction in this basis.

DirToUnsignedAngle ( Dir direction ) : double

Returns the smallest non-negative angle corresponding to the given direction in this basis.

FromDirectionAndUnits ( Dir origin, double unitsPerTurn, bool isClockwisePositive ) : Basis

Returns a basis with a zero angle along the given direction, and units that satisfy the given constraints.

ToString ( ) : string
TurnToAngle ( Turn turn ) : double

Returns the angle corresponding to a rotation by the given turn in this basis.

Private Methods

Method Description
Basis ( double origin, double counterClockwiseRadiansPerUnit ) : System

Method Details

AngleToDir() public method

Returns the direction corresponding to the given angle in this basis.
public AngleToDir ( double angle ) : Dir
angle double
return Dir

AngleToTurn() public method

Returns the turn corresponding to a rotation by the given angle in this basis.
public AngleToTurn ( double angle ) : Turn
angle double
return Turn

DirToSignedAngle() public method

Returns the smallest positive or negative angle corresponding to the given direction in this basis.
public DirToSignedAngle ( Dir direction ) : double
direction Dir
return double

DirToUnsignedAngle() public method

Returns the smallest non-negative angle corresponding to the given direction in this basis.
public DirToUnsignedAngle ( Dir direction ) : double
direction Dir
return double

FromDirectionAndUnits() public static method

Returns a basis with a zero angle along the given direction, and units that satisfy the given constraints.
public static FromDirectionAndUnits ( Dir origin, double unitsPerTurn, bool isClockwisePositive ) : Basis
origin Dir
unitsPerTurn double
isClockwisePositive bool
return Basis

ToString() public method

public ToString ( ) : string
return string

TurnToAngle() public method

Returns the angle corresponding to a rotation by the given turn in this basis.
public TurnToAngle ( Turn turn ) : double
turn Turn
return double

Property Details

Natural public_oe static_oe property

Natural angular units. The origin is along the positive X axis. The unit is counter-clockwise radians. For example, angle 0 is along the vector (x:1,y:0) and angle pi/2 is along the vector (x:0, y:1).
public static Basis,Strilanc.Angle Natural
return Basis