Table of Contents

Struct CoordinateRange

Namespace
ScottPlot
Assembly
ScottPlot.dll

Represents a range of values between a pair of bounding coordinates on a single axis. Inverted ranges are permitted, but Min is always less than Max and IsInverted indicates whether this range is inverted.

public readonly struct CoordinateRange
Inherited Members
Extension Methods

Constructors

CoordinateRange(double, double)

Represents a range of values between a pair of bounding coordinates on a single axis. Inverted ranges are permitted, but Min is always less than Max and IsInverted indicates whether this range is inverted.

public CoordinateRange(double value1, double value2)

Parameters

value1 double
value2 double

Fields

IsInverted

public readonly bool IsInverted

Field Value

bool

Max

public readonly double Max

Field Value

double

Min

public readonly double Min

Field Value

double

Value1

public readonly double Value1

Field Value

double

Value2

public readonly double Value2

Field Value

double

Properties

Center

Value located in the center of the range, between Value1 and Value2 (may be negative)

public double Center { get; }

Property Value

double

Length

Distance from Min to Max (always positive)

public double Length { get; }

Property Value

double

NoLimits

This magic value is used to indicate the range has no defined limits. It is equal to an inverted infinite range [NaN, NaN]

public static CoordinateRange NoLimits { get; }

Property Value

CoordinateRange

NotSet

This magic value is used to indicate the range has not been set. It is equal to an inverted infinite range [∞, -∞]

public static CoordinateRange NotSet { get; }

Property Value

CoordinateRange

Span

Distance from Value1 to Value2 (may be negative)

public double Span { get; }

Property Value

double

Methods

Contains(double)

Returns true if the given position is within the range (inclusive)

public bool Contains(double value)

Parameters

value double

Returns

bool

Equals(CoordinateRange)

public bool Equals(CoordinateRange other)

Parameters

other CoordinateRange

Returns

bool

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Expanded(double)

Return a new range expanded to include the given point

public CoordinateRange Expanded(double value)

Parameters

value double

Returns

CoordinateRange

Extrema(IEnumerable<double>)

Return the range of values spanned by the given collection (ignoring NaN)

public static CoordinateRange Extrema(IEnumerable<double> values)

Parameters

values IEnumerable<double>

Returns

CoordinateRange

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Overlaps(CoordinateRange)

Indicates whether two ranges have any overlapping values

public bool Overlaps(CoordinateRange other)

Parameters

other CoordinateRange

Returns

bool

Rectified()

Return the present range rectified so Value1 is not greater than Value2

public CoordinateRange Rectified()

Returns

CoordinateRange

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(CoordinateRange, CoordinateRange)

public static bool operator ==(CoordinateRange a, CoordinateRange b)

Parameters

a CoordinateRange
b CoordinateRange

Returns

bool

operator !=(CoordinateRange, CoordinateRange)

public static bool operator !=(CoordinateRange a, CoordinateRange b)

Parameters

a CoordinateRange
b CoordinateRange

Returns

bool