|
static float | ToRadians (this float f) |
| Converts the degree value to radian value.
|
|
static float | ToDegrees (this float f) |
| Converts the radian value to degree value.
|
|
static bool | ApproximatelyEqualsTo (this float f, float comparedValue, float epsilon=MBMath.Epsilon) |
|
static bool | ApproximatelyEquals (float first, float second, float epsilon=MBMath.Epsilon) |
|
static bool | IsValidValue (float f) |
| Checks the value.
|
|
static int | ClampIndex (int value, int minValue, int maxValue) |
| Clamps the input value, max exclusive.
|
|
static int | ClampInt (int value, int minValue, int maxValue) |
| Clamps the input value.
|
|
static float | ClampFloat (float value, float minValue, float maxValue) |
| Clamps the input value.
|
|
static void | ClampUnit (ref float value) |
| Clamps the input value between 0.0f and 1.0f.
|
|
static int | GetNumberOfBitsToRepresentNumber (uint value) |
|
static IEnumerable< ValueTuple< T, int > > | DistributeShares< T > (int totalAward, IEnumerable< T > stakeHolders, Func< T, int > shareFunction) |
|
static int | GetNumberOfBitsToRepresentNumber (ulong value) |
|
static float | Lerp (float valueFrom, float valueTo, float amount, float minimumDifference=Epsilon) |
| Linear interpolation between two floating values.
|
|
static float | LinearExtrapolation (float valueFrom, float valueTo, float amount) |
| Linear extrapolation with respect to two floating values.
|
|
static Vec3 | Lerp (Vec3 vecFrom, Vec3 vecTo, float amount, float minimumDifference) |
| Linear interpolation between two Vec3.
|
|
static Vec2 | Lerp (Vec2 vecFrom, Vec2 vecTo, float amount, float minimumDifference) |
|
static float | Map (float input, float inputMinimum, float inputMaximum, float outputMinimum, float outputMaximum) |
| Re-maps a number from one range to another.
|
|
static Mat3 | Lerp (ref Mat3 matFrom, ref Mat3 matTo, float amount, float minimumDifference) |
| Linear interpolation between two Matrices.
|
|
static float | LerpRadians (float valueFrom, float valueTo, float amount, float minChange, float maxChange) |
| Linear interpolation between two radian values.
|
|
static float | SplitLerp (float value1, float value2, float value3, float cutOff, float amount, float minimumDifference) |
| Linear interpolation between three floating values with a split value.
|
|
static float | InverseLerp (float valueFrom, float valueTo, float value) |
| Inverse Linear interpolation between two floating values.
|
|
static float | SmoothStep (float edge0, float edge1, float value) |
| SmoothStep performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. 0 when x <= edge0 and 1 when x >= edge1.
|
|
static float | BilinearLerp (float topLeft, float topRight, float botLeft, float botRight, float x, float y) |
| Bilinear interpolation between four floating values on a uniform grid.
|
|
static float | GetSmallestDifferenceBetweenTwoAngles (float fromAngle, float toAngle) |
| Calculates the (smallest) difference angle between two angles.
|
|
static float | ClampAngle (float angle, float restrictionCenter, float restrictionRange) |
| Restricts an angle to a specified portion of a disk, a circular sector.
|
|
static float | WrapAngle (float angle) |
| Reduces a given angle to a value between π and -π.
|
|
static bool | IsBetween (float numberToCheck, float bottom, float top) |
|
static bool | IsBetween (int value, int minValue, int maxValue) |
|
static bool | IsBetweenInclusive (float numberToCheck, float bottom, float top) |
|
static uint | ColorFromRGBA (float red, float green, float blue, float alpha) |
|
static Color | HSBtoRGB (float hue, float saturation, float brightness, float outputAlpha) |
|
static Vec3 | RGBtoHSB (Color rgb) |
|
static Vec3 | GammaCorrectRGB (float gamma, Vec3 rgb) |
|
static Vec3 | GetClosestPointInLineSegmentToPoint (Vec3 point, Vec3 lineSegmentBegin, Vec3 lineSegmentEnd) |
|
static bool | GetRayPlaneIntersectionPoint (in Vec3 planeNormal, in Vec3 planeCenter, in Vec3 rayOrigin, in Vec3 rayDirection, out float t) |
|
static Vec2 | GetClosestPointInLineSegmentToPoint (Vec2 point, Vec2 lineSegmentBegin, Vec2 lineSegmentEnd) |
|
static bool | CheckLineToLineSegmentIntersection (Vec2 lineOrigin, Vec2 lineDirection, Vec2 segmentA, Vec2 segmentB, out float t, out Vec2 intersect) |
| Computes intersection of a line (specified by a point on line and direction) with a line segment (specified by two segment points A and B)
|
|
static float | GetClosestPointOnLineSegment (Vec2 point, Vec2 segmentA, Vec2 segmentB, out Vec2 closest) |
|
static bool | IntersectRayWithBoundaryList (Vec2 rayOrigin, Vec2 rayDir, List< Vec2 > boundaries, out Vec2 intersectionPoint) |
| Intersects a ray with the given boundary list (in consecutive point order) and returns true (if intersection exists)
|
|
static string | ToOrdinal (int number) |
| Coverts a cardinal number to ordinal.
|
|
static int | IndexOfMax< T > (MBReadOnlyList< T > array, Func< T, int > func) |
|
static T | MaxElement< T > (IEnumerable< T > collection, Func< T, float > func) |
| Return the element that has the top return value for the supplied function.
|
|
static ValueTuple< T, T > | MaxElements2< T > (IEnumerable< T > collection, Func< T, float > func) |
|
static ValueTuple< T, T, T > | MaxElements3< T > (IEnumerable< T > collection, Func< T, float > func) |
| Return the three elements that have the top return values for the supplied function.
|
|
static ValueTuple< T, T, T, T > | MaxElements4< T > (IEnumerable< T > collection, Func< T, float > func) |
| Return the four elements that have the top return values for the supplied function.
|
|
static ValueTuple< T, T, T, T, T > | MaxElements5< T > (IEnumerable< T > collection, Func< T, float > func) |
| Return the five elements that have the top return values for the supplied function.
|
|
static IList< T > | TopologySort< T > (IEnumerable< T > source, Func< T, IEnumerable< T > > getDependencies) |
| Topology sort a list of items. getDependencies func needs to return the same instance of items for comparing.
|
|