C# Class Sparrow.Utils.NumberUtil

Afficher le fichier Open project: fmotagarcia/sparrow-sharp

Méthodes publiques

Свойство Type Description
CosLUT float[]
PIHALF float
PIQUARTER float
SinLUT float[]

Méthodes publiques

Méthode Description
Clamp ( float value, float min, float max ) : float
Equals ( float a, float b ) : bool

checks if two numbers are equal with a small margin of error

FastCos ( float angle ) : float

Fast cosinus calculation with a look up table. Note that it is less accurate than Math.Cos; the largest error is around 0.3 degrees;

FastSin ( float angle ) : float

Fast sinus calculation with a look up table. Note that it is less accurate than Math.Sin; the largest error is around 0.3 degrees

NextPowerOfTwo ( float number ) : int
NextPowerOfTwo ( int number ) : int

Private Methods

Méthode Description
NumberUtil ( ) : System

Method Details

Clamp() public static méthode

public static Clamp ( float value, float min, float max ) : float
value float
min float
max float
Résultat float

Equals() public static méthode

checks if two numbers are equal with a small margin of error
public static Equals ( float a, float b ) : bool
a float
b float
Résultat bool

FastCos() public static méthode

Fast cosinus calculation with a look up table. Note that it is less accurate than Math.Cos; the largest error is around 0.3 degrees;
public static FastCos ( float angle ) : float
angle float
Résultat float

FastSin() public static méthode

Fast sinus calculation with a look up table. Note that it is less accurate than Math.Sin; the largest error is around 0.3 degrees
public static FastSin ( float angle ) : float
angle float
Résultat float

NextPowerOfTwo() public static méthode

public static NextPowerOfTwo ( float number ) : int
number float
Résultat int

NextPowerOfTwo() public static méthode

public static NextPowerOfTwo ( int number ) : int
number int
Résultat int

Property Details

CosLUT public_oe static_oe property

Lookup table for fast cosine calculations
public static float[] CosLUT
Résultat float[]

PIHALF public_oe static_oe property

public static float PIHALF
Résultat float

PIQUARTER public_oe static_oe property

public static float PIQUARTER
Résultat float

SinLUT public_oe static_oe property

Lookup table for fast sine calculations
public static float[] SinLUT
Résultat float[]