C# Class LitDev.LDMath

Datei anzeigen Open project: litdev1/LitDev

Public Methods

Method Description
ArcCos ( Primitive cos ) : Primitive

ArcCos in degrees.

ArcSin ( Primitive sin ) : Primitive

ArcSin in degrees.

ArcTan ( Primitive tan ) : Primitive

ArcTan in degrees.

Base2Decimal ( Primitive number, Primitive Base ) : Primitive

Convert a base number to a decimal integer.

Convert2Cartesian ( Primitive x1, Primitive y1, Primitive dist, Primitive angle ) : Primitive

Calculate the coordinates of a point 2, from point 1 and the distance and angle to point 2.

Convert2Radial ( Primitive x1, Primitive y1, Primitive x2, Primitive y2 ) : Primitive

Calculate the distance and angle between two points.

Cos ( Primitive angle ) : Primitive

Cos of an angle in degrees.

Cosh ( Primitive angle ) : Primitive

Hyperbolic cosine.

Decimal2Base ( Primitive number, Primitive Base ) : Primitive

Convert a decimal integer to another base.

Evaluate ( Primitive expression ) : Primitive

Evaluate a string expression to a number or boolean (if possible). The JScript command 'eval' is used and may therefore allow more complex JScript manipulations (also see LDInline). The TextWindow should be visible prior to using this method if later use of the TextWindow is required.

Evaluate2 ( Primitive expression ) : Primitive

Evaluate a string expression to a number (if possible). An alternative to Evaluate that behaves nicely with the TextWindow.

Evaluate3 ( Primitive expression ) : Primitive

Evaluate a string expression to a boolean "True" or "False" (if possible). An alternative to Evaluate that behaves nicely with the TextWindow.

Exp ( Primitive value ) : Primitive

Exponential of a number e^x.

FixDecimal ( Primitive number, Primitive digits ) : Primitive

Round a number to a fixed number of decimal places. Additional training decimal 0s are added if required.

FixSigFig ( Primitive number, Primitive digits ) : Primitive

Round a number to a fixed number of significant figures.

Rotate ( Primitive x1, Primitive y1, Primitive x2, Primitive y2, Primitive angle ) : Primitive

Rotate point 2 clockwise about point 1.

Sin ( Primitive angle ) : Primitive

Sin of an angle in degrees.

Sinh ( Primitive angle ) : Primitive

Hyperbolic sine.

Tan ( Primitive angle ) : Primitive

Tan of an angle in degrees.

Tanh ( Primitive angle ) : Primitive

Hyperbolic tangent.

Truncate ( Primitive value ) : Primitive

Get the integral part of a number.

Method Details

ArcCos() public static method

ArcCos in degrees.
public static ArcCos ( Primitive cos ) : Primitive
cos Primitive /// The Cos of the angle. ///
return Primitive

ArcSin() public static method

ArcSin in degrees.
public static ArcSin ( Primitive sin ) : Primitive
sin Primitive /// The Sin of the angle. ///
return Primitive

ArcTan() public static method

ArcTan in degrees.
public static ArcTan ( Primitive tan ) : Primitive
tan Primitive /// The Tan of the angle. ///
return Primitive

Base2Decimal() public static method

Convert a base number to a decimal integer.
public static Base2Decimal ( Primitive number, Primitive Base ) : Primitive
number Primitive The base number to convert (non negative).
Base Primitive The base to convert from (2 binary) (8 octal) (16 hex) or other bases up to 36.
return Primitive

Convert2Cartesian() public static method

Calculate the coordinates of a point 2, from point 1 and the distance and angle to point 2.
public static Convert2Cartesian ( Primitive x1, Primitive y1, Primitive dist, Primitive angle ) : Primitive
x1 Primitive /// The X coordinate of point 1. ///
y1 Primitive /// The Y coordinate of point 1. ///
dist Primitive /// The distance to point 2. ///
angle Primitive /// The angle to point 2 in degrees. ///
return Primitive

Convert2Radial() public static method

Calculate the distance and angle between two points.
public static Convert2Radial ( Primitive x1, Primitive y1, Primitive x2, Primitive y2 ) : Primitive
x1 Primitive /// The X coordinate of point 1. ///
y1 Primitive /// The Y coordinate of point 1. ///
x2 Primitive /// The X coordinate of point 2. ///
y2 Primitive /// The Y coordinate of point 2. ///
return Primitive

Cos() public static method

Cos of an angle in degrees.
public static Cos ( Primitive angle ) : Primitive
angle Primitive /// The angle in degrees. ///
return Primitive

Cosh() public static method

Hyperbolic cosine.
public static Cosh ( Primitive angle ) : Primitive
angle Primitive Angle in radians.
return Primitive

Decimal2Base() public static method

Convert a decimal integer to another base.
public static Decimal2Base ( Primitive number, Primitive Base ) : Primitive
number Primitive The decimal integer to convert (non negative).
Base Primitive The base to convert to (2 binary) (8 octal) (16 hex) or other bases to 36.
return Primitive

Evaluate() public static method

Evaluate a string expression to a number or boolean (if possible). The JScript command 'eval' is used and may therefore allow more complex JScript manipulations (also see LDInline). The TextWindow should be visible prior to using this method if later use of the TextWindow is required.
public static Evaluate ( Primitive expression ) : Primitive
expression Primitive The expression to evaluate, e.g. "(9/6) + 3" or "2.1 > 1.5".
return Primitive

Evaluate2() public static method

Evaluate a string expression to a number (if possible). An alternative to Evaluate that behaves nicely with the TextWindow.
public static Evaluate2 ( Primitive expression ) : Primitive
expression Primitive The expression to evaluate, e.g. "1e6 + 6/4".
return Primitive

Evaluate3() public static method

Evaluate a string expression to a boolean "True" or "False" (if possible). An alternative to Evaluate that behaves nicely with the TextWindow.
public static Evaluate3 ( Primitive expression ) : Primitive
expression Primitive The expression to evaluate to a boolean, e.g. "21.3 > 16".
return Primitive

Exp() public static method

Exponential of a number e^x.
public static Exp ( Primitive value ) : Primitive
value Primitive The value to raise e to the power of.
return Primitive

FixDecimal() public static method

Round a number to a fixed number of decimal places. Additional training decimal 0s are added if required.
public static FixDecimal ( Primitive number, Primitive digits ) : Primitive
number Primitive The number to change.
digits Primitive The number of decimal places.
return Primitive

FixSigFig() public static method

Round a number to a fixed number of significant figures.
public static FixSigFig ( Primitive number, Primitive digits ) : Primitive
number Primitive The number to change.
digits Primitive The number of significant figures.
return Primitive

Rotate() public static method

Rotate point 2 clockwise about point 1.
public static Rotate ( Primitive x1, Primitive y1, Primitive x2, Primitive y2, Primitive angle ) : Primitive
x1 Primitive /// The X coordinate of point 1. ///
y1 Primitive /// The Y coordinate of point 1. ///
x2 Primitive /// The X coordinate of point 2. ///
y2 Primitive /// The Y coordinate of point 2. ///
angle Primitive /// The angle to rotate point 2 around point 1 in degrees. ///
return Primitive

Sin() public static method

Sin of an angle in degrees.
public static Sin ( Primitive angle ) : Primitive
angle Primitive /// The angle in degrees. ///
return Primitive

Sinh() public static method

Hyperbolic sine.
public static Sinh ( Primitive angle ) : Primitive
angle Primitive Angle in radians.
return Primitive

Tan() public static method

Tan of an angle in degrees.
public static Tan ( Primitive angle ) : Primitive
angle Primitive /// The angle in degrees. ///
return Primitive

Tanh() public static method

Hyperbolic tangent.
public static Tanh ( Primitive angle ) : Primitive
angle Primitive Angle in radians.
return Primitive

Truncate() public static method

Get the integral part of a number.
public static Truncate ( Primitive value ) : Primitive
value Primitive The number to truncate.
return Primitive