C# Класс Sparrow.Utils.NumberUtil

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
CosLUT float[]
PIHALF float
PIQUARTER float
SinLUT float[]

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
NumberUtil ( ) : System

Описание методов

Clamp() публичный статический Метод

public static Clamp ( float value, float min, float max ) : float
value float
min float
max float
Результат float

Equals() публичный статический Метод

checks if two numbers are equal with a small margin of error
public static Equals ( float a, float b ) : bool
a float
b float
Результат bool

FastCos() публичный статический Метод

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
Результат float

FastSin() публичный статический Метод

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
Результат float

NextPowerOfTwo() публичный статический Метод

public static NextPowerOfTwo ( float number ) : int
number float
Результат int

NextPowerOfTwo() публичный статический Метод

public static NextPowerOfTwo ( int number ) : int
number int
Результат int

Описание свойств

CosLUT публичное статическое свойство

Lookup table for fast cosine calculations
public static float[] CosLUT
Результат float[]

PIHALF публичное статическое свойство

public static float PIHALF
Результат float

PIQUARTER публичное статическое свойство

public static float PIQUARTER
Результат float

SinLUT публичное статическое свойство

Lookup table for fast sine calculations
public static float[] SinLUT
Результат float[]