Class Interval
A simple parametric data representing an "interval" between two numbers.
Inheritance
Inherited Members
Syntax
public class Interval
Constructors
| Improve this Doc View SourceInterval(Double, Double)
Creates an instance of an interval given a minimum and a maximum value.
Declaration
public Interval(double t0, double t1)
Parameters
Type | Name | Description |
---|---|---|
System.Double | t0 | |
System.Double | t1 |
Properties
| Improve this Doc View SourceIsDecreasing
True if t0 is less than t1.
Declaration
public bool IsDecreasing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsIncreasing
True if t1 is greater than t0.
Declaration
public bool IsIncreasing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSingleton
True if t0 == t1.
Declaration
public bool IsSingleton { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Length
Gets the length of the interval.
If the interval is decreasing, negative number will be returned.
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
System.Double |
Max
Returns the largest value in the interval.
Declaration
public double Max { get; }
Property Value
Type | Description |
---|---|
System.Double |
Mid
Gets the value between the interval's min and max values.
Declaration
public double Mid { get; }
Property Value
Type | Description |
---|---|
System.Double |
Min
Returns the smallest value in the interval.
Declaration
public double Min { get; }
Property Value
Type | Description |
---|---|
System.Double |
T0
Gets the minimum value of the interval.
Declaration
public double T0 { get; }
Property Value
Type | Description |
---|---|
System.Double |
T1
Gets the maximum value of the interval.
Declaration
public double T1 { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceDivide(Interval, Int32)
Computes a collection of evenly spaced numbers over a specified domain.
Declaration
public static IList<double> Divide(Interval domain, int step)
Parameters
Type | Name | Description |
---|---|---|
Interval | domain | Numeric domain. |
System.Int32 | step | Number of steps. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Double> | A collection of equally spaced numbers. |
ParameterAt(Double)
Converts normalized parameter to interval value, or pair of values.
Declaration
public double ParameterAt(double normalizedParameter)
Parameters
Type | Name | Description |
---|---|---|
System.Double | normalizedParameter | The normalized parameter between 0 and 1. |
Returns
Type | Description |
---|---|
System.Double | Interval parameter t0*(1.0-normalizedParameter) + t1*normalizedParameter. |