Various utility functions for mathematical and numerical operations.
More...
|
static double | Clamp (double x, double min, double max) |
| Clamps a double value to a given range. More...
|
|
static int | Clamp (int x, int min, int max) |
| Clamps a int value to a given range. More...
|
|
static double | Log10 (double x) |
| Computes the base-10 logarithm of a double value. More...
|
|
static int | Wrap (int index, int max) |
| Computes an index which wraps around a given maximum value. For values &ge 0, this is equals to val % max . For values < 0, this is equal to max - (-val) % max More...
|
|
static double | Average (double x1, double x2) |
| Computes the average of two numbers. More...
|
|
static double | Max (double v1, double v2, double v3) |
| Computes the maximum fo three values More...
|
|
static double | Max (double v1, double v2, double v3, double v4) |
| Computes the maximum of four values More...
|
|
static double | Min (double v1, double v2, double v3) |
| Computes the minimum of four values More...
|
|
static double | Min (double v1, double v2, double v3, double v4) |
| Computes the minimum of four values More...
|
|
Various utility functions for mathematical and numerical operations.
static double NetTopologySuite.Mathematics.MathUtil.Average |
( |
double |
x1, |
|
|
double |
x2 |
|
) |
| |
|
static |
Computes the average of two numbers.
- Parameters
-
- Returns
- The average of the inputs
static double NetTopologySuite.Mathematics.MathUtil.Clamp |
( |
double |
x, |
|
|
double |
min, |
|
|
double |
max |
|
) |
| |
|
static |
Clamps a double
value to a given range.
- Parameters
-
x | The value to clamp |
min | The minimum value of the range |
max | The maximum value of the range |
- Returns
- The clamped value
static int NetTopologySuite.Mathematics.MathUtil.Clamp |
( |
int |
x, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
|
static |
Clamps a int
value to a given range.
- Parameters
-
x | The value to clamp |
min | The minimum value of the range |
max | The maximum value of the range |
- Returns
- The clamped value
static double NetTopologySuite.Mathematics.MathUtil.Log10 |
( |
double |
x | ) |
|
|
static |
Computes the base-10 logarithm of a double
value.
-
If the argument is NaN or less than zero, then the result is NaN.
-
If the argument is positive infinity, then the result is positive infinity.
-
If the argument is positive zero or negative zero, then the result is negative infinity.
- Parameters
-
- Returns
- The value log a, the base-10 logarithm of the input value
static double NetTopologySuite.Mathematics.MathUtil.Max |
( |
double |
v1, |
|
|
double |
v2, |
|
|
double |
v3 |
|
) |
| |
|
static |
Computes the maximum fo three values
- Parameters
-
v1 | A number |
v2 | A number |
v3 | A number |
- Returns
- The maximum value of v1 , v2 and v3
static double NetTopologySuite.Mathematics.MathUtil.Max |
( |
double |
v1, |
|
|
double |
v2, |
|
|
double |
v3, |
|
|
double |
v4 |
|
) |
| |
|
static |
Computes the maximum of four values
- Parameters
-
v1 | A number |
v2 | A number |
v3 | A number |
v4 | A number |
- Returns
- The maximum value of v1 , v2 , v3 and v4
static double NetTopologySuite.Mathematics.MathUtil.Min |
( |
double |
v1, |
|
|
double |
v2, |
|
|
double |
v3 |
|
) |
| |
|
static |
Computes the minimum of four values
- Parameters
-
v1 | A number |
v2 | A number |
v3 | A number |
- Returns
- The minimum value of v1 , v2 and v3
static double NetTopologySuite.Mathematics.MathUtil.Min |
( |
double |
v1, |
|
|
double |
v2, |
|
|
double |
v3, |
|
|
double |
v4 |
|
) |
| |
|
static |
Computes the minimum of four values
- Parameters
-
v1 | A number |
v2 | A number |
v3 | A number |
v4 | A number |
- Returns
- The minimum value of v1 , v2 , v3 and v4
static int NetTopologySuite.Mathematics.MathUtil.Wrap |
( |
int |
index, |
|
|
int |
max |
|
) |
| |
|
static |
Computes an index which wraps around a given maximum value. For values &ge 0, this is equals to val % max
. For values < 0, this is equal to max - (-val) % max
- Parameters
-
index | The index to wrap |
max | The maximum value (or modulus) |
- Returns
- The wrapped index
The documentation for this class was generated from the following file:
- NetTopologySuite/NetTopologySuite/Mathematics/MathUtil.cs