MathUtilities Class

Summary

Provides math utilities not provided in System.Math.
Namespace
Avalonia.Utilities
Base Types
  • object
graph BT Type-->Base0["object"] Type["MathUtilities"] class Type type-node

Syntax

public static class MathUtilities

Methods

Name Value Summary
AreClose(double, double) bool
AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other.
static
AreClose(double, double, double) bool
AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other.
static
AreClose(float, float) bool
AreClose - Returns whether or not two floats are "close". That is, whether or not they are within epsilon of each other.
static
Clamp(double, double, double) double
Clamps a value between a minimum and maximum value.
static
Clamp(int, int, int) int
Clamps a value between a minimum and maximum value.
static
Deg2Rad(double) double
Converts an angle in degrees to radians.
static
Grad2Rad(double) double
Converts an angle in gradians to radians.
static
GreaterThan(double, double) bool
GreaterThan - Returns whether or not the first double is greater than the second double. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number.
static
GreaterThan(float, float) bool
GreaterThan - Returns whether or not the first float is greater than the second float. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number.
static
GreaterThanOrClose(double, double) bool
GreaterThanOrClose - Returns whether or not the first double is greater than or close to the second double. That is, whether or not the first is strictly greater than or within epsilon of the other number.
static
GreaterThanOrClose(float, float) bool
GreaterThanOrClose - Returns whether or not the first float is greater than or close to the second float. That is, whether or not the first is strictly greater than or within epsilon of the other number.
static
IsOne(double) bool
IsOne - Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.
static
IsOne(float) bool
IsOne - Returns whether or not the float is "close" to 1. Same as AreClose(float, 1), but this is faster.
static
IsZero(double) bool
IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.
static
IsZero(float) bool
IsZero - Returns whether or not the float is "close" to 0. Same as AreClose(float, 0), but this is faster.
static
LessThan(double, double) bool
LessThan - Returns whether or not the first double is less than the second double. That is, whether or not the first is strictly less than *and* not within epsilon of the other number.
static
LessThan(float, float) bool
LessThan - Returns whether or not the first float is less than the second float. That is, whether or not the first is strictly less than *and* not within epsilon of the other number.
static
LessThanOrClose(double, double) bool
LessThanOrClose - Returns whether or not the first double is less than or close to the second double. That is, whether or not the first is strictly less than or within epsilon of the other number.
static
LessThanOrClose(float, float) bool
LessThanOrClose - Returns whether or not the first float is less than or close to the second float. That is, whether or not the first is strictly less than or within epsilon of the other number.
static
Turn2Rad(double) double
Converts an angle in turns to radians.
static