Region1

References
[IoId("00000000-E7EB-4FFD-99EC-2EA9F2368B2C")] public struct Region1 : IStorable, IEquatable<Region1>, IComparable<Region1>
A one-dimensional region, or set of intervals on the real number line.

Constructors

Region1

#
public Region1(double lower, double upper)
Create a region from a single interval.
lower (double)Lower boundary.
upper (double)Upper boundary.

Region1

#
public Region1(IReader reader)
Deserialisation constructor.
reader (IReader)

Properties

Empty

#
public static Region1 Empty { get; }
Gets the empty region.

Full

#
public static Region1 Full { get; }
Gets the full region covering the entire numberline.

IntervalCount

#
public int IntervalCount { get; }
Gets the number of defined intervals.

IsEmpty

#
public bool IsEmpty { get; }
Gets whether this region1 is entirely empty.

IsFull

#
public bool IsFull { get; }
Gets whether this region1 is entirely full.

Length

#
public double Length { get; }
Gets the length of the valid intervals.

Methods

CompareTo

#
public int CompareTo(Region1 other)
other (Region1)

Contains

#
public bool Contains(double value, bool includeBoundaries = true)
Gets whether a specific value is inside the region intervals.
value (double)Value to test.
includeBoundaries (bool = true)If true, values on interval boundaries are considered part of the interior.
True if the value is inside or on the boundary of the region intervals.

Equals

#
public bool Equals(Region1 other)
other (Region1)

FindInterval

#
public int FindInterval(double value)
Gets the interval index which contains the given value.
value (double)

IntervalBoundaries

#
public void IntervalBoundaries(int index, out double lower, out double upper)
Gets the lower and upper boundaries of the interval with the given index.
index (int)
lower (out double)
upper (out double)

Store

#
public void Store(IWriter writer)
Serialise this Region1.
writer (IWriter)
Store

ToString

#
public override string ToString()

ValueAtLength

#
public double ValueAtLength(double length, int intervalIndex)
Gets the value as measured from the start of the specified region interval. The length is only measured inside intervals.
length (double)Length to measure.
intervalIndex (int)Index of interval for measuring start.

ValueAtLength

#
public double ValueAtLength(double length)
Gets the value as measured from the start of the first region interval. The length is only measured inside intervals.
length (double)Length to measure.

Operators

OperationResultDescription
Region1+Region1Region1Create a union of two regions.
Region1+doubleRegion1Shift all region intervals right by some distance.
Region1/doubleRegion1Divide all region boundaries by some factor.
Region1*doubleRegion1Multiply all region boundaries by some factor.
Region1-Region1Region1Create a difference of two regions.
Region1-doubleRegion1Shift all region intervals left by some distance.
-Region1Region1Negate a Region1.

Convertors

OperationResultDescription
implicit(double, double)Region1
implicit(int, int)Region1
implicitIntervalRegion1