FMath Class Reference

math wrapper and convenience functions More...

List of all members.

Static Public Member Functions

static float Radians (float x)
 convert from degrees to radians
static float Degrees (float x)
 convert from radians to degrees
static float Sin (float x)
 equivalent to (float)Math.Sin(x)
static float Cos (float x)
 equivalent to (float)Math.Cos(x)
static float Tan (float x)
 equivalent to (float)Math.Tan(x)
static float Asin (float x)
 equivalent to (float)Math.Asin(x)
static float Acos (float x)
 equivalent to (float)Math.Acos(x)
static float Atan (float x)
 equivalent to (float)Math.Atan(x)
static float Atan2 (float x, float y)
 equivalent to (float)Math.Atan2(x,y)
static float Sqrt (float x)
 equivalent to (float)Math.Sqrt(x)
static float Pow (float x, float y)
 equivalent to (float)Math.Pow(x,y)
static float Exp (float x)
 equivalent to (float)Math.Exp(x)
static float Log (float x)
 equivalent to (float)Math.Log(x)
static float Log10 (float x)
 equivalent to (float)Math.Log10(x)
static float Abs (float x)
 equivalent to Math.Abs(x)
static int Sign (float x)
 equivalent to Math.Sign(x)
static float Min (float x, float y)
 equivalent to Math.Min(x,y)
static float Max (float x, float y)
 equivalent to Math.Max(x,y)
static float Floor (float x)
 equivalent to (float)Math.Floor(x)
static float Ceiling (float x)
 equivalent to (float)Math.Ceiling(x)
static float Round (float x)
 equivalent to (float)Math.Round(x)
static float Truncate (float x)
 equivalent to (float)Math.Truncate(x)
static float Clamp (float x, float min, float max)
 clamp between two values
static float Repeat (float x, float min, float max)
 repeat between two values
static float Mirror (float x, float min, float max)
 repeat shuttlewise between two values
static float Lerp (float x1, float x2, float f)
 lerp between two values
static float MoveTo (float x1, float x2, float amount)
 move one value to another value by specified amount
static float Step (float edge, float x)
 step function returning 0 or 1
static float LinearStep (float min, float max, float x)
 linear step function returning a value between 0 and 1
static float SmoothStep (float min, float max, float x)
 smooth step function returning a value between 0 and 1

Public Attributes

const float E = (float)Math.E
 E.
const float PI = (float)Math.PI
 PI.
const float DegToRad = (float)( Math.PI / 180.0 )
 conversion ratio from degrees to radians
const float RadToDeg = (float)( 180.0 / Math.PI )
 conversion ratio from radians to degrees

Detailed Description

math wrapper and convenience functions


Member Function Documentation

static float Abs ( float  x) [static]

equivalent to Math.Abs(x)

Parameters:
xthe value to take the absolute value of
Returns:
the absolute value of x
static float Acos ( float  x) [static]

equivalent to (float)Math.Acos(x)

Parameters:
xthe value to take the acos of
Returns:
the acos of x
static float Asin ( float  x) [static]

equivalent to (float)Math.Asin(x)

Parameters:
xthe value to take the asin of
Returns:
the asin of x
static float Atan ( float  x) [static]

equivalent to (float)Math.Atan(x)

Parameters:
xthe value to take the atan of
Returns:
the atan of x
static float Atan2 ( float  x,
float  y 
) [static]

equivalent to (float)Math.Atan2(x,y)

Parameters:
xthe x coordinate to take the atan2 of
ythe y coordinate to take the atan2 of
Returns:
the atan2 of (x,y)
static float Ceiling ( float  x) [static]

equivalent to (float)Math.Ceiling(x)

Parameters:
xthe value to take the ceil of
Returns:
the ceil of x
static float Clamp ( float  x,
float  min,
float  max 
) [static]

clamp between two values

Parameters:
xthe value to clamp
minthe min to clamp against
maxthe max to clamp against
Returns:
x clamped between min and max
static float Cos ( float  x) [static]

equivalent to (float)Math.Cos(x)

Parameters:
xthe value to take the cos of
Returns:
the cos of x
static float Degrees ( float  x) [static]

convert from radians to degrees

Parameters:
xthe value to convert
Returns:
value converted from radians to degrees
static float Exp ( float  x) [static]

equivalent to (float)Math.Exp(x)

Parameters:
xthe value to take the exp of
Returns:
the exp of x
static float Floor ( float  x) [static]

equivalent to (float)Math.Floor(x)

Parameters:
xthe value to take the floor of
Returns:
the floor of x
static float Lerp ( float  x1,
float  x2,
float  f 
) [static]

lerp between two values

Parameters:
x1value 1
x2value 2
flerp amount
Returns:
the result of lerping f between x1 and x2
static float LinearStep ( float  min,
float  max,
float  x 
) [static]

linear step function returning a value between 0 and 1

Parameters:
minthe min to be compared
maxthe max to be compared
xthe value to be compared
Returns:
0.0f if x<min, 1.0f if x>max, linearly interpolated if min<=x<=max
static float Log ( float  x) [static]

equivalent to (float)Math.Log(x)

Parameters:
xthe value to take the log of
Returns:
the log of x
static float Log10 ( float  x) [static]

equivalent to (float)Math.Log10(x)

Parameters:
xthe value to take the log 10 of
Returns:
the log 10 of x
static float Max ( float  x,
float  y 
) [static]

equivalent to Math.Max(x,y)

Parameters:
xfirst input to max
ysecond input to max
Returns:
the max of x and y
static float Min ( float  x,
float  y 
) [static]

equivalent to Math.Min(x,y)

Parameters:
xfirst input to min
ysecond input to min
Returns:
the min of x and y
static float Mirror ( float  x,
float  min,
float  max 
) [static]

repeat shuttlewise between two values

Parameters:
xthe value to repeat
minthe min to repeat over
maxthe max to repeat over
Returns:
x repeated shuttlewise between min and max
static float MoveTo ( float  x1,
float  x2,
float  amount 
) [static]

move one value to another value by specified amount

Parameters:
x1value 1
x2value 2
amountstep amount
Returns:
value moved to another value by specified amount
static float Pow ( float  x,
float  y 
) [static]

equivalent to (float)Math.Pow(x,y)

Parameters:
xthe value to raise
ythe power to raise to
Returns:
x to y power
static float Radians ( float  x) [static]

convert from degrees to radians

Parameters:
xthe value to convert
Returns:
value converted from degrees to radians
static float Repeat ( float  x,
float  min,
float  max 
) [static]

repeat between two values

Parameters:
xthe value to repeat
minthe min to repeat over
maxthe max to repeat over
Returns:
x repeated between min and max
static float Round ( float  x) [static]

equivalent to (float)Math.Round(x)

Parameters:
xthe value to take the round of
Returns:
the round of x
static int Sign ( float  x) [static]

equivalent to Math.Sign(x)

Parameters:
xthe value to take the sign of
Returns:
the sign of x
static float Sin ( float  x) [static]

equivalent to (float)Math.Sin(x)

Parameters:
xthe value to take the sin of
Returns:
the sin of x
static float SmoothStep ( float  min,
float  max,
float  x 
) [static]

smooth step function returning a value between 0 and 1

Parameters:
minthe min to be compared
maxthe max to be compared
xthe value to be compared
Returns:
0.0f if x<min, 1.0f if x>max, smoothly interpolated if min<=x<=max
static float Sqrt ( float  x) [static]

equivalent to (float)Math.Sqrt(x)

Parameters:
xthe value to take the square root of
Returns:
the square root of x
static float Step ( float  edge,
float  x 
) [static]

step function returning 0 or 1

Parameters:
edgethe edge to be compared
xthe value to be compared
Returns:
0.0f if x<edge, 1.0f if x>=edge
static float Tan ( float  x) [static]

equivalent to (float)Math.Tan(x)

Parameters:
xthe value to take the tan of
Returns:
the tan of x
static float Truncate ( float  x) [static]

equivalent to (float)Math.Truncate(x)

Parameters:
xthe value to take the trunc of
Returns:
the trunc of x

Member Data Documentation

const float DegToRad = (float)( Math.PI / 180.0 )

conversion ratio from degrees to radians

const float E = (float)Math.E

E.

const float PI = (float)Math.PI

PI.

const float RadToDeg = (float)( 180.0 / Math.PI )

conversion ratio from radians to degrees