Class Interval
public record Interval : IEquatable<Interval>
- Inheritance
-
Interval
- Implements
- Inherited Members
Constructors
Interval(double, double)
public Interval(double Min, double Max)
Parameters
Properties
Max
public double Max { get; init; }
Property Value
Min
public double Min { get; init; }
Property Value
Methods
Remap(double, Interval, Interval)
Takes a number in the range [oldMin, oldMax] and returns its equivalent value in the range [newMin, newMax]
public static double Remap(double value, Interval oldInterval, Interval newInterval)
Parameters
value
doubleThe original value
oldInterval
IntervalThe original interval, inclusive
newInterval
IntervalThe new interval, inclusive
Returns
- double
A number in the range [newMin, newMax], corresponding to the original number on the original range
Remap(double, double, double, double, double)
Takes a number in the range [oldMin, oldMax] and returns its equivalent value in the range [newMin, newMax]
public static double Remap(double value, double oldMin, double oldMax, double newMin, double newMax)
Parameters
value
doubleThe original value
oldMin
doubleThe original minimum, inclusive
oldMax
doubleThe original maximum, inclusive
newMin
doubleThe new minimum, inclusive
newMax
doubleThe new maximum, inclusive
Returns
- double
A number in the range [newMin, newMax], corresponding to the original number on the original range
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.