BGC Tools
|
Static Public Member Functions | |
static int | Mod (int x, int m) |
x mod m More... | |
static float | Mod (float x, float m) |
x mod m More... | |
static double | Tanh (double angle) |
Hyperbolic Tangent in radian More... | |
static double | Sinh (double angle) |
Hyperbolic Sine More... | |
static double | Cosh (double angle) |
Hyperbolic Cosine More... | |
static float | Tanh (float angle) |
Hyperbolic Tangent in radian More... | |
static float | Sinh (float angle) |
Hyperbolic Sine More... | |
static float | Cosh (float angle) |
Hyperbolic Cosine More... | |
static bool | IsPowerOfTwo (this int number) |
Find out whether the provided 32 bit integer is a perfect power of two. More... | |
static int | ToNextExponentOf2 (this int x) |
static int | CeilingToPowerOfTwo (this int v) |
static decimal | Clamp (decimal value, decimal min, decimal max) |
static double | Clamp (double value, double min, double max) |
static float | Clamp (float value, float min, float max) |
static long | Clamp (long value, long min, long max) |
static ulong | Clamp (ulong value, ulong min, ulong max) |
static int | Clamp (int value, int min, int max) |
static uint | Clamp (uint value, uint min, uint max) |
static short | Clamp (short value, short min, short max) |
static ushort | Clamp (ushort value, ushort min, ushort max) |
static byte | Clamp (byte value, byte min, byte max) |
static sbyte | Clamp (sbyte value, sbyte min, sbyte max) |
static decimal | Clamp01 (decimal value) |
Clamps value to range [0, 1] More... | |
static double | Clamp01 (double value) |
Clamps value to range [0, 1] More... | |
static float | Clamp01 (float value) |
Clamps value to range [0, 1] More... | |
static decimal | Lerp (decimal initial, decimal final, decimal t) |
Linearly interpolates between initial and final by t , clamps t to range [0,1] More... | |
static decimal | LerpUnclamped (decimal initial, decimal final, decimal t) |
Linearly interpolates between initial and final by t without clamping t between 0 and 1 More... | |
static double | Lerp (double initial, double final, double t) |
Linearly interpolates between initial and final by t , clamps t to range [0,1] More... | |
static double | LerpUnclamped (double initial, double final, double t) |
Linearly interpolates between initial and final by t without clamping t between 0 and 1 More... | |
static float | Lerp (float initial, float final, float t) |
Linearly interpolates between initial and final by t , clamps t to range [0,1] More... | |
static float | LerpUnclamped (float initial, float final, float t) |
Linearly interpolates between initial and final by t without clamping t between 0 and 1 More... | |
static decimal | Repeat (decimal value, decimal min, decimal max) |
static double | Repeat (double value, double min, double max) |
static float | Repeat (float value, float min, float max) |
static long | Repeat (long value, long min, long max) |
static int | Repeat (int value, int min, int max) |
static bool | Approximately (float a, float b) |
static bool | Approximately (double a, double b) |
Private Attributes | |
const float | FLOAT_MANTISSA_LOWER_BOUND = 1.1920929E-7f |
const float | FLOAT_SMALLEST_NORMAL = 1.1754943508E-38f |
const float | FLOAT_COMPARISON_MAX_FACTOR = 8 * FLOAT_MANTISSA_LOWER_BOUND |
const float | FLOAT_COMPARISON_LOWER_BOUND = 8 * FLOAT_SMALLEST_NORMAL |
const double | DOUBLE_MANTISSA_LOWER_BOUND = 2.220446E-16 |
const double | DOUBLE_SMALLEST_NORMAL = 2.2250738585072014E10-308 |
const double | DOUBLE_COMPARISON_MAX_FACTOR = 8 * DOUBLE_MANTISSA_LOWER_BOUND |
const double | DOUBLE_COMPARISON_LOWER_BOUND = 8 * DOUBLE_SMALLEST_NORMAL |
Definition at line 6 of file GeneralMath.cs.
|
inlinestatic |
Definition at line 326 of file GeneralMath.cs.
Referenced by BGC.Mathematics.Complex64.Equals(), and BGC.Mathematics.Complex32.Equals().
|
inlinestatic |
Definition at line 338 of file GeneralMath.cs.
|
inlinestatic |
Definition at line 124 of file GeneralMath.cs.
|
static |
Referenced by BGC.Audio.Spatial.NearestValidOffset(), BGC.Audio.Synthesis.SilenceStream.Read(), BGC.Audio.SimpleAudioClip.Read(), BGC.Audio.InterlacingAudioClip.Read(), BGC.Audio.NormalizedMonoClip.Read(), BGC.Audio.Synthesis.WhiteNoiseStream.Read(), BGC.Audio.CrossFadingRefClip.Read(), BGC.Audio.Synthesis.NoiseAudioClip.Read(), BGC.Audio.Synthesis.SweepAudioClip.Read(), BGC.Audio.Synthesis.STMAudioClip.Read(), BGC.Audio.Filters.SinglePassPhaseReencoder.Read(), BGC.Audio.Filters.MultiConvolutionFilter.ReadBody(), BGC.Audio.Filters.StreamEnveloper.Seek(), BGC.Audio.Filters.StreamTimeShiftFilter.Seek(), BGC.Audio.AnalyticStreams.AnalyticFrequencyModulationFilter.Seek(), BGC.Audio.AnalyticStreams.AnalyticStreamWindower.Seek(), BGC.Audio.AnalyticStreams.AnalyticStreamFrequencyShifter.Seek(), BGC.Audio.AnalyticStreams.AnalyticStreamCenterer.Seek(), BGC.Audio.Filters.AllPassFilter.Seek(), BGC.Audio.Filters.StreamCenterer.Seek(), BGC.Audio.AnalyticStreams.AnalyticStreamConverter.Seek(), BGC.Audio.Filters.StreamTruncator.Seek(), BGC.Audio.Filters.FrequencyModulationFilter.Seek(), BGC.Audio.Filters.StreamWindower.Seek(), BGC.Audio.AnalyticStreams.AnalyticADSREnvelope.Seek(), BGC.IO.SubStream.Seek(), BGC.Audio.Synthesis.ADSREnvelope.Seek(), BGC.Audio.Normalization.SPLToAdjustmentDB(), BGC.Audio.Filters.ContinuousFilter.UpdateCoefficients(), and BGC.UI.ColorUIExtensions.updateColorValue().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
Clamps value to range [0, 1]
Definition at line 177 of file GeneralMath.cs.
|
inlinestatic |
Clamps value to range [0, 1]
Definition at line 194 of file GeneralMath.cs.
|
inlinestatic |
Clamps value to range [0, 1]
Definition at line 211 of file GeneralMath.cs.
|
static |
Hyperbolic Cosine
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
Referenced by BGC.Mathematics.Complex64.Cos(), BGC.Mathematics.Complex32.Cos(), BGC.Mathematics.Complex64.Cosh(), BGC.Mathematics.Complex32.Cosh(), BGC.Mathematics.Complex64.Sin(), BGC.Mathematics.Complex32.Sin(), BGC.Mathematics.Complex64.Sinh(), BGC.Mathematics.Complex32.Sinh(), BGC.Mathematics.Complex64.Tanh(), and BGC.Mathematics.Complex32.Tanh().
|
static |
Hyperbolic Cosine
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
|
static |
Find out whether the provided 32 bit integer is a perfect power of two.
number | The number to very whether it's a power of two. |
|
inlinestatic |
Linearly interpolates between initial and final by t , clamps t to range [0,1]
Definition at line 232 of file GeneralMath.cs.
Referenced by BGC.MonoUtility.Interpolation.FadeImageAlpha.CallAction(), BGC.Audio.Calibration.GetLevelOffset(), and BGC.Audio.Visualization.SpectralDecomp.Linterp().
|
inlinestatic |
Linearly interpolates between initial and final by t , clamps t to range [0,1]
Definition at line 251 of file GeneralMath.cs.
|
inlinestatic |
Linearly interpolates between initial and final by t , clamps t to range [0,1]
Definition at line 270 of file GeneralMath.cs.
|
inlinestatic |
Linearly interpolates between initial and final by t without clamping t between 0 and 1
Definition at line 242 of file GeneralMath.cs.
|
inlinestatic |
Linearly interpolates between initial and final by t without clamping t between 0 and 1
Definition at line 261 of file GeneralMath.cs.
|
inlinestatic |
Linearly interpolates between initial and final by t without clamping t between 0 and 1
Definition at line 280 of file GeneralMath.cs.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 288 of file GeneralMath.cs.
Referenced by BGC.Audio.CarrierTone.CarrierTone().
|
inlinestatic |
Definition at line 294 of file GeneralMath.cs.
|
inlinestatic |
Definition at line 300 of file GeneralMath.cs.
|
inlinestatic |
Definition at line 306 of file GeneralMath.cs.
|
inlinestatic |
Definition at line 312 of file GeneralMath.cs.
|
static |
Hyperbolic Sine
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
Referenced by BGC.Mathematics.Complex64.Cos(), BGC.Mathematics.Complex32.Cos(), BGC.Mathematics.Complex64.Cosh(), BGC.Mathematics.Complex32.Cosh(), BGC.Mathematics.Complex64.Sin(), BGC.Mathematics.Complex32.Sin(), BGC.Mathematics.Complex64.Sinh(), BGC.Mathematics.Complex32.Sinh(), BGC.Mathematics.Complex64.Tanh(), and BGC.Mathematics.Complex32.Tanh().
|
static |
Hyperbolic Sine
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
|
inlinestatic |
Hyperbolic Tangent in radian
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
Definition at line 38 of file GeneralMath.cs.
Referenced by BGC.Audio.Envelopes.SigmoidEnvelope.Read(), BGC.Audio.Envelopes.SigmoidEnvelope.ReadNextSample(), BGC.Mathematics.Complex64.Tanh(), and BGC.Mathematics.Complex32.Tanh().
|
inlinestatic |
Hyperbolic Tangent in radian
angle | The hyperbolic angle, i.e. the area of the hyperbolic sector. |
Definition at line 79 of file GeneralMath.cs.
|
static |
|
private |
Definition at line 336 of file GeneralMath.cs.
|
private |
Definition at line 335 of file GeneralMath.cs.
|
private |
Definition at line 333 of file GeneralMath.cs.
|
private |
Definition at line 334 of file GeneralMath.cs.
|
private |
Definition at line 324 of file GeneralMath.cs.
|
private |
Definition at line 323 of file GeneralMath.cs.
|
private |
Definition at line 321 of file GeneralMath.cs.
|
private |
Definition at line 322 of file GeneralMath.cs.