TrueSync
Static Public Member Functions | Static Public Attributes | List of all members
TrueSync.TSMath Class Reference

Contains common math operations. More...

Static Public Member Functions

static FP Sqrt (FP number)
 Gets the square root. More...
 
static FP Max (FP val1, FP val2)
 Gets the maximum number of two values. More...
 
static FP Min (FP val1, FP val2)
 Gets the minimum number of two values. More...
 
static FP Max (FP val1, FP val2, FP val3)
 Gets the maximum number of three values. More...
 
static FP Clamp (FP value, FP min, FP max)
 Returns a number which is within [min,max] More...
 
static void Absolute (ref TSMatrix matrix, out TSMatrix result)
 Changes every sign of the matrix entry to '+' More...
 
static FP Sin (FP value)
 Returns the sine of value. More...
 
static FP Cos (FP value)
 Returns the cosine of value. More...
 
static FP Tan (FP value)
 Returns the tan of value. More...
 
static FP Asin (FP value)
 Returns the arc sine of value. More...
 
static FP Acos (FP value)
 Returns the arc cosine of value. More...
 
static FP Atan (FP value)
 Returns the arc tan of value. More...
 
static FP Atan2 (FP y, FP x)
 Returns the arc tan of coordinates x-y. More...
 
static FP Floor (FP value)
 Returns the largest integer less than or equal to the specified number. More...
 
static FP Ceiling (FP value)
 Returns the smallest integral value that is greater than or equal to the specified number. More...
 
static FP Round (FP value)
 Rounds a value to the nearest integral value. If the value is halfway between an even and an uneven value, returns the even value. More...
 
static int Sign (FP value)
 Returns a number indicating the sign of a Fix64 number. Returns 1 if the value is positive, 0 if is 0, and -1 if it is negative. More...
 
static FP Abs (FP value)
 Returns the absolute value of a Fix64 number. Note: Abs(Fix64.MinValue) == Fix64.MaxValue. More...
 

Static Public Attributes

static FP Pi = FP.Pi
 PI constant. More...
 
static FP PiOver2 = FP.PiOver2
 PI over 2 constant.
 
static FP Epsilon = FP.Epsilon
 A small value often used to decide if numeric results are zero. More...
 
static FP Deg2Rad = FP.Deg2Rad
 Degree to radians constant.
 
static FP Rad2Deg = FP.Rad2Deg
 Radians to degree constant.
 

Detailed Description

Contains common math operations.

Definition at line 25 of file TSMath.cs.

Member Function Documentation

static FP TrueSync.TSMath.Abs ( FP  value)
static

Returns the absolute value of a Fix64 number. Note: Abs(Fix64.MinValue) == Fix64.MaxValue.

Definition at line 219 of file TSMath.cs.

static void TrueSync.TSMath.Absolute ( ref TSMatrix  matrix,
out TSMatrix  result 
)
static

Changes every sign of the matrix entry to '+'

Parameters
matrixThe matrix.
resultThe absolute matrix.

Definition at line 123 of file TSMath.cs.

static FP TrueSync.TSMath.Acos ( FP  value)
static

Returns the arc cosine of value.

Definition at line 167 of file TSMath.cs.

static FP TrueSync.TSMath.Asin ( FP  value)
static

Returns the arc sine of value.

Definition at line 160 of file TSMath.cs.

static FP TrueSync.TSMath.Atan ( FP  value)
static

Returns the arc tan of value.

Definition at line 174 of file TSMath.cs.

static FP TrueSync.TSMath.Atan2 ( FP  y,
FP  x 
)
static

Returns the arc tan of coordinates x-y.

Definition at line 181 of file TSMath.cs.

static FP TrueSync.TSMath.Ceiling ( FP  value)
static

Returns the smallest integral value that is greater than or equal to the specified number.

Definition at line 195 of file TSMath.cs.

static FP TrueSync.TSMath.Clamp ( FP  value,
FP  min,
FP  max 
)
static

Returns a number which is within [min,max]

Parameters
valueThe value to clamp.
minThe minimum value.
maxThe maximum value.
Returns
The clamped value.

Definition at line 110 of file TSMath.cs.

static FP TrueSync.TSMath.Cos ( FP  value)
static

Returns the cosine of value.

Definition at line 146 of file TSMath.cs.

static FP TrueSync.TSMath.Floor ( FP  value)
static

Returns the largest integer less than or equal to the specified number.

Definition at line 188 of file TSMath.cs.

static FP TrueSync.TSMath.Max ( FP  val1,
FP  val2 
)
static

Gets the maximum number of two values.

Parameters
val1The first value.
val2The second value.
Returns
Returns the largest value.

Definition at line 71 of file TSMath.cs.

static FP TrueSync.TSMath.Max ( FP  val1,
FP  val2,
FP  val3 
)
static

Gets the maximum number of three values.

Parameters
val1The first value.
val2The second value.
val3The third value.
Returns
Returns the largest value.

Definition at line 96 of file TSMath.cs.

static FP TrueSync.TSMath.Min ( FP  val1,
FP  val2 
)
static

Gets the minimum number of two values.

Parameters
val1The first value.
val2The second value.
Returns
Returns the smallest value.

Definition at line 83 of file TSMath.cs.

static FP TrueSync.TSMath.Round ( FP  value)
static

Rounds a value to the nearest integral value. If the value is halfway between an even and an uneven value, returns the even value.

Definition at line 203 of file TSMath.cs.

static int TrueSync.TSMath.Sign ( FP  value)
static

Returns a number indicating the sign of a Fix64 number. Returns 1 if the value is positive, 0 if is 0, and -1 if it is negative.

Definition at line 211 of file TSMath.cs.

static FP TrueSync.TSMath.Sin ( FP  value)
static

Returns the sine of value.

Definition at line 139 of file TSMath.cs.

static FP TrueSync.TSMath.Sqrt ( FP  number)
static

Gets the square root.

Parameters
numberThe number to get the square root from.
Returns

Definition at line 59 of file TSMath.cs.

static FP TrueSync.TSMath.Tan ( FP  value)
static

Returns the tan of value.

Definition at line 153 of file TSMath.cs.

Member Data Documentation

FP TrueSync.TSMath.Epsilon = FP.Epsilon
static

A small value often used to decide if numeric results are zero.

Definition at line 41 of file TSMath.cs.

FP TrueSync.TSMath.Pi = FP.Pi
static

PI constant.

Definition at line 30 of file TSMath.cs.


The documentation for this class was generated from the following file: