Struct Domain1d
A 1 dimensional interval or domain.
Inherited Members
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public struct Domain1d
Constructors
Domain1d(Double, Double)
Construct a 1D Domain
Declaration
public Domain1d(double min = 0, double max = 1)
Parameters
Type | Name | Description |
---|---|---|
System.Double | min | The lower bound of the domain. |
System.Double | max | The upper bound of the domain. |
Properties
Length
The length of the domain — Max-Min. Note that for non-increasing domains this value can be negative.
Declaration
[JsonIgnore]
public readonly double Length { get; }
Property Value
Type | Description |
---|---|
System.Double |
Max
The upper bound of the domain
Declaration
public readonly double Max { get; }
Property Value
Type | Description |
---|---|
System.Double |
Min
The lower bound of the domain
Declaration
public readonly double Min { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
DivideByCount(Int32)
Split a domain evenly into N subdomains.
Declaration
public Domain1d[] DivideByCount(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n | The number of domains |
Returns
Type | Description |
---|---|
Domain1d[] | An array of N equally-sized subdomains. |
IsCloseToBoundary(Double)
Test if a position is within global tolerance of the domain boundary.
Declaration
public bool IsCloseToBoundary(double position)
Parameters
Type | Name | Description |
---|---|---|
System.Double | position | The position to test. |
Returns
Type | Description |
---|---|
System.Boolean | True if the position is within tolerance of the domain Min or Max. |
Mid()
Calculate the middle of the domain.
Declaration
public double Mid()
Returns
Type | Description |
---|---|
System.Double |
SplitAt(Double)
Split domain into two at a position within its extents. Positions at the domain's ends will be rejected.
Declaration
public Domain1d[] SplitAt(double position)
Parameters
Type | Name | Description |
---|---|---|
System.Double | position | The position value at which to split the domain. |
Returns
Type | Description |
---|---|
Domain1d[] | An array of 2 1d domains split at the designated position. |
ToString()
Convert to string of the form "From Min to Max"
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |