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
valuedoubleThe original value
oldIntervalIntervalThe original interval, inclusive
newIntervalIntervalThe 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
valuedoubleThe original value
oldMindoubleThe original minimum, inclusive
oldMaxdoubleThe original maximum, inclusive
newMindoubleThe new minimum, inclusive
newMaxdoubleThe 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.