![]() |
VR-Link C# API Documentation
|
Contains common mathematical functions and constants. More...
Collaboration diagram for makVrl.MathHelper:Static Public Member Functions | |
| static long | NextPowerOfTwo (long n) |
| Returns the next power of two that is larger than the specified number. | |
| static int | NextPowerOfTwo (int n) |
| Returns the next power of two that is larger than the specified number. | |
| static float | NextPowerOfTwo (float n) |
| Returns the next power of two that is larger than the specified number. | |
| static double | NextPowerOfTwo (double n) |
| Returns the next power of two that is larger than the specified number. | |
| static long | Factorial (int n) |
| Calculates the factorial of a given natural number. | |
| static long | BinomialCoefficient (int n, int k) |
| Calculates the binomial coefficient n above k . | |
| static float | InverseSqrtFast (float x) |
| Returns an approximation of the inverse square root of left number. | |
| static double | InverseSqrtFast (double x) |
| Returns an approximation of the inverse square root of left number. | |
| static float | DegreesToRadians (float degrees) |
| Convert degrees to radians | |
| static float | RadiansToDegrees (float radians) |
| Convert radians to degrees | |
| static double | DegreesToRadians (double degrees) |
| Convert degrees to radians | |
| static double | RadiansToDegrees (double radians) |
| Convert radians to degrees | |
| static void | Swap (ref double a, ref double b) |
| Swaps two double values. | |
| static void | Swap (ref float a, ref float b) |
| Swaps two float values. | |
| static double | ModPerZero (double x, double per) |
| static double | ModPerLo (double x, double min, double max) |
| static double | ModPerHi (double x, double min, double max) |
| static Vector3f | directedRotRateFromVec (Vector3f pqr, double theta) |
Public Attributes | |
| const float | Pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f |
| Defines the value of Pi as a System.Single. | |
| const float | PiOver2 = Pi / 2 |
| Defines the value of Pi divided by two as a System.Single. | |
| const float | PiOver3 = Pi / 3 |
| Defines the value of Pi divided by three as a System.Single. | |
| const float | PiOver4 = Pi / 4 |
| Definesthe value of Pi divided by four as a System.Single. | |
| const float | PiOver6 = Pi / 6 |
| Defines the value of Pi divided by six as a System.Single. | |
| const float | TwoPi = 2 * Pi |
| Defines the value of Pi multiplied by two as a System.Single. | |
| const float | ThreePiOver2 = 3 * Pi / 2 |
| Defines the value of Pi multiplied by 3 and divided by two as a System.Single. | |
| const float | E = 2.71828182845904523536f |
| Defines the value of E as a System.Single. | |
| const float | Log10E = 0.434294482f |
| Defines the base-10 logarithm of E. | |
| const float | Log2E = 1.442695041f |
| Defines the base-2 logarithm of E. | |
Contains common mathematical functions and constants.
|
inlinestatic |
Calculates the binomial coefficient n above k .
| n | The n. |
| k | The k. |
References makVrl.MathHelper.Factorial().
|
inlinestatic |
Convert degrees to radians
| degrees | An angle in degrees |
Referenced by makVrl.UtmReferencePoint.geod2utm(), makVrl.TopographicCoord.getTaitBryan(), f18.VehicleSim.init(), talk_Sharp.talk.Main(), f18.f18.Main(), f18.VehicleSim.simTick(), and makVrl.UtmReferencePoint.utm2geod().
|
inlinestatic |
Convert degrees to radians
| degrees | An angle in degrees |
|
inlinestatic |
Referenced by makVrl.DeadReckoner.setRotationalVelocity().
|
inlinestatic |
Calculates the factorial of a given natural number.
| n | The number. |
Referenced by makVrl.MathHelper.BinomialCoefficient().
|
inlinestatic |
Returns an approximation of the inverse square root of left number.
| x | A number. |
This is an improved implementation of the the method known as Carmack's inverse square root which is found in the Quake III source code. This implementation comes from http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see http://www.beyond3d.com/content/articles/8/
Referenced by makVrl.MathHelper.InverseSqrtFast(), makVrl.Vector3f.NormalizeFast(), makVrl.Vector3d.NormalizeFast(), makVrl.Vector2.NormalizeFast(), makVrl.Vector4d.NormalizeFast(), makVrl.Vector4.NormalizeFast(), and makVrl.Vector2d.NormalizeFast().
|
inlinestatic |
Returns an approximation of the inverse square root of left number.
| x | A number. |
This is an improved implementation of the the method known as Carmack's inverse square root which is found in the Quake III source code. This implementation comes from http://www.codemaestro.com/reviews/review00000105.html. For the history of this method, see http://www.beyond3d.com/content/articles/8/
References makVrl.MathHelper.InverseSqrtFast().
|
inlinestatic |
Referenced by makVrl.UtmReferencePoint.geod2utm().
|
inlinestatic |
|
inlinestatic |
Referenced by f18.VehicleSim.simTick().
|
inlinestatic |
Returns the next power of two that is larger than the specified number.
| n | The specified number. |
|
inlinestatic |
Returns the next power of two that is larger than the specified number.
| n | The specified number. |
|
inlinestatic |
Returns the next power of two that is larger than the specified number.
| n | The specified number. |
|
inlinestatic |
Returns the next power of two that is larger than the specified number.
| n | The specified number. |
|
inlinestatic |
Convert radians to degrees
| radians | An angle in radians |
Referenced by makVrl.UtmReferencePoint.geod2utm(), and makVrl.UtmReferencePoint.utm2geod().
|
inlinestatic |
Convert radians to degrees
| radians | An angle in radians |
|
inlinestatic |
Swaps two double values.
| a | The first value. |
| b | The second value. |
|
inlinestatic |
Swaps two float values.
| a | The first value. |
| b | The second value. |
| const float makVrl.MathHelper.E = 2.71828182845904523536f |
Defines the value of E as a System.Single.
| const float makVrl.MathHelper.Log10E = 0.434294482f |
Defines the base-10 logarithm of E.
| const float makVrl.MathHelper.Log2E = 1.442695041f |
Defines the base-2 logarithm of E.
| const float makVrl.MathHelper.Pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930382f |
Defines the value of Pi as a System.Single.
| const float makVrl.MathHelper.PiOver2 = Pi / 2 |
Defines the value of Pi divided by two as a System.Single.
Referenced by makVrl.ReferenceEllipsoid.rad_to_geo().
| const float makVrl.MathHelper.PiOver3 = Pi / 3 |
Defines the value of Pi divided by three as a System.Single.
| const float makVrl.MathHelper.PiOver4 = Pi / 4 |
Definesthe value of Pi divided by four as a System.Single.
| const float makVrl.MathHelper.PiOver6 = Pi / 6 |
Defines the value of Pi divided by six as a System.Single.
| const float makVrl.MathHelper.ThreePiOver2 = 3 * Pi / 2 |
Defines the value of Pi multiplied by 3 and divided by two as a System.Single.
| const float makVrl.MathHelper.TwoPi = 2 * Pi |
Defines the value of Pi multiplied by two as a System.Single.