Struct GorgonRangeD
A type that represents a range between two double values.
Inherited Members
Namespace: Gorgon.Core
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonRangeD : IGorgonEquatableByRef<GorgonRangeD>, IEquatable<GorgonRangeD>, IComparable<GorgonRangeD>
Remarks
This a means to determine the range between a minimum double value and a maximum double value. Use this object to determine if a value falls within a specific range of values.
Constructors
| Edit this page View SourceGorgonRangeD(GorgonRangeD)
Initializes a new instance of the GorgonRangeD struct.
Declaration
public GorgonRangeD(GorgonRangeD minMax)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | minMax | The min max value to copy. |
GorgonRangeD(double, double)
Initializes a new instance of the GorgonRangeD struct.
Declaration
public GorgonRangeD(double min, double max)
Parameters
Type | Name | Description |
---|---|---|
double | min | The minimum value. |
double | max | The maximum value. |
Fields
| Edit this page View SourceEmpty
An empty range value.
Declaration
public static readonly GorgonRangeD Empty
Field Value
Type | Description |
---|---|
GorgonRangeD |
Maximum
The maximum value in the range.
Declaration
public readonly double Maximum
Field Value
Type | Description |
---|---|
double |
Minimum
The minimum value in the range.
Declaration
public readonly double Minimum
Field Value
Type | Description |
---|---|
double |
Properties
| Edit this page View SourceIsEmpty
Property to return whether the range is empty or not.
Declaration
[JsonIgnore]
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Range
Property to return the range between the two values.
Declaration
[JsonIgnore]
public double Range { get; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceAdd(GorgonRangeD, GorgonRangeD)
Function to add two GorgonRangeD values together.
Declaration
public static GorgonRangeD Add(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to add |
GorgonRangeD | right | The right GorgonRangeD value to add. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD representing the total of both ranges. |
Add(in GorgonRangeD, in GorgonRangeD, out GorgonRangeD)
Function to add two GorgonRangeD values together.
Declaration
public static void Add(in GorgonRangeD left, in GorgonRangeD right, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to add |
GorgonRangeD | right | The right GorgonRangeD value to add. |
GorgonRangeD | result | A new GorgonRangeD representing the total of both ranges. |
CompareTo(GorgonRangeD)
Compares the current object with another object of the same type.
Declaration
public int CompareTo(GorgonRangeD other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other. |
Contains(double)
Function to return whether the double value falls within this GorgonRangeD.
Declaration
public bool Contains(double value)
Parameters
Type | Name | Description |
---|---|---|
double | value | Value to test. |
Returns
Type | Description |
---|---|
bool | true if the value falls into the range, false if not. |
Divide(GorgonRangeD, double)
Function to divide a GorgonRangeD by a double value.
Declaration
public static GorgonRangeD Divide(GorgonRangeD range, double scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The GorgonRangeD range value to divide. |
double | scalar | The double scalar value to divide by. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD representing the product of the |
Exceptions
Type | Condition |
---|---|
DivideByZeroException | Thrown if the |
Divide(in GorgonRangeD, double, out GorgonRangeD)
Function to divide a GorgonRangeD by a double value.
Declaration
public static void Divide(in GorgonRangeD range, double scalar, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The GorgonRangeD range value to divide. |
double | scalar | The double scalar value to divide by. |
GorgonRangeD | result | A new GorgonRangeD representing the product of the |
Exceptions
Type | Condition |
---|---|
DivideByZeroException | Thrown if the |
Equals(GorgonRangeD)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonRangeD other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(in GorgonRangeD)
Function to compare this instance with another.
Declaration
public bool Equals(in GorgonRangeD other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Another object to compare to. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceExpand(GorgonRangeD, double)
Function to expand a GorgonRangeD by a specific amount.
Declaration
public static GorgonRangeD Expand(GorgonRangeD range, double amount)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | A GorgonRangeD to expand. |
double | amount | The amount to expand the GorgonRangeD by. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD value, increased in size by |
Expand(in GorgonRangeD, double, out GorgonRangeD)
Function to expand a GorgonRangeD by a specific amount.
Declaration
public static void Expand(in GorgonRangeD range, double amount, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | A GorgonRangeD to expand. |
double | amount | The amount to expand the GorgonRangeD by. |
GorgonRangeD | result | A new GorgonRangeD value, increased in size by |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceMultiply(GorgonRangeD, GorgonRangeD)
Function to multiply two GorgonRangeD ranges together.
Declaration
public static GorgonRangeD Multiply(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to multiply. |
GorgonRangeD | right | The right GorgonRangeD value to multiply. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD value representing the product of both ranges. |
Multiply(GorgonRangeD, double)
Function to multiply a GorgonRangeD by a scalar double value.
Declaration
public static GorgonRangeD Multiply(GorgonRangeD range, double scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range to multiply by. |
double | scalar | The double scalar value to multiply. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD representing the product of the |
Multiply(in GorgonRangeD, in GorgonRangeD, out GorgonRangeD)
Function to multiply two GorgonRangeD ranges together.
Declaration
public static void Multiply(in GorgonRangeD left, in GorgonRangeD right, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to multiply. |
GorgonRangeD | right | The right GorgonRangeD value to multiply. |
GorgonRangeD | result | A new GorgonRangeD value representing the product of both ranges. |
Multiply(in GorgonRangeD, double, out GorgonRangeD)
Function to multiply a GorgonRangeD by a scalar double value.
Declaration
public static void Multiply(in GorgonRangeD range, double scalar, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range to multiply by. |
double | scalar | The double scalar value to multiply. |
GorgonRangeD | result | A new GorgonRangeD representing the product of the |
Shrink(GorgonRangeD, double)
Function to shrink a GorgonRangeD by a specific amount.
Declaration
public static GorgonRangeD Shrink(GorgonRangeD range, double amount)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | A GorgonRangeD to shrink. |
double | amount | The amount to shrink the GorgonRangeD by. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD value, decreased in size by |
Shrink(in GorgonRangeD, double, out GorgonRangeD)
Function to shrink a GorgonRangeD by a specific amount.
Declaration
public static void Shrink(in GorgonRangeD range, double amount, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | A GorgonRangeD to shrink. |
double | amount | The amount to shrink the GorgonRangeD by. |
GorgonRangeD | result | A new GorgonRangeD value, decreased in size by |
Subtract(GorgonRangeD, GorgonRangeD)
Function to subtract two GorgonRangeD ranges from each other.
Declaration
public static GorgonRangeD Subtract(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to subtract. |
GorgonRangeD | right | The right GorgonRangeD value to subtract. |
Returns
Type | Description |
---|---|
GorgonRangeD | A new GorgonRangeD value representing the difference of both ranges. |
Subtract(in GorgonRangeD, in GorgonRangeD, out GorgonRangeD)
Function to subtract two GorgonRangeD ranges from each other.
Declaration
public static void Subtract(in GorgonRangeD left, in GorgonRangeD right, out GorgonRangeD result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left GorgonRangeD value to subtract. |
GorgonRangeD | right | The right GorgonRangeD value to subtract. |
GorgonRangeD | result | A new GorgonRangeD value representing the difference of both ranges. |
ToGorgonRange(GorgonRangeD)
Function to perform an explicit conversion from GorgonRangeD to GorgonRange.
Declaration
public static GorgonRange ToGorgonRange(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRange | The result of the conversion. |
ToGorgonRangeF(GorgonRangeD)
Function to perform an explicit conversion from GorgonRangeD to GorgonRangeF.
Declaration
public static GorgonRangeF ToGorgonRangeF(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeF | The result of the conversion. |
ToGorgonRangeM(GorgonRangeD)
Function to perform an explicit conversion from GorgonRangeD to GorgonRangeM.
Declaration
public static GorgonRangeM ToGorgonRangeM(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the conversion. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string containing a fully qualified type name. |
Overrides
Operators
| Edit this page View Sourceoperator +(GorgonRangeD, GorgonRangeD)
Implements the operator +.
Declaration
public static GorgonRangeD operator +(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left range. |
GorgonRangeD | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |
operator /(GorgonRangeD, double)
Implements the operator /.
Declaration
public static GorgonRangeD operator /(GorgonRangeD left, double scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left range. |
double | scalar | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |
operator ==(GorgonRangeD, GorgonRangeD)
Implements the operator ==.
Declaration
public static bool operator ==(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left. |
GorgonRangeD | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
explicit operator GorgonRange(GorgonRangeD)
Performs an explicit conversion from GorgonRangeD to GorgonRange.
Declaration
public static explicit operator GorgonRange(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRange | The result of the conversion. |
explicit operator GorgonRangeF(GorgonRangeD)
Performs an explicit conversion from GorgonRangeD to GorgonRangeF.
Declaration
public static explicit operator GorgonRangeF(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeF | The result of the conversion. |
explicit operator GorgonRangeM(GorgonRangeD)
Performs an explicit conversion from GorgonRangeD to GorgonRangeM.
Declaration
public static explicit operator GorgonRangeM(GorgonRangeD range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the conversion. |
operator >(GorgonRangeD, GorgonRangeD)
Implements the operator >.
Declaration
public static bool operator >(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left instance to compare. |
GorgonRangeD | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator >=(GorgonRangeD, GorgonRangeD)
Implements the operator >=.
Declaration
public static bool operator >=(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left instance to compare. |
GorgonRangeD | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator !=(GorgonRangeD, GorgonRangeD)
Implements the operator ==.
Declaration
public static bool operator !=(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left. |
GorgonRangeD | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator <(GorgonRangeD, GorgonRangeD)
Implements the operator >.
Declaration
public static bool operator <(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left instance to compare. |
GorgonRangeD | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator <=(GorgonRangeD, GorgonRangeD)
Implements the operator >=.
Declaration
public static bool operator <=(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left instance to compare. |
GorgonRangeD | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator *(GorgonRangeD, GorgonRangeD)
Implements the operator *.
Declaration
public static GorgonRangeD operator *(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left range. |
GorgonRangeD | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |
operator *(GorgonRangeD, double)
Implements the operator *.
Declaration
public static GorgonRangeD operator *(GorgonRangeD left, double scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left range. |
double | scalar | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |
operator *(double, GorgonRangeD)
Implements the operator *.
Declaration
public static GorgonRangeD operator *(double scalar, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
double | scalar | The scalar value. |
GorgonRangeD | right | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |
operator -(GorgonRangeD, GorgonRangeD)
Implements the operator -.
Declaration
public static GorgonRangeD operator -(GorgonRangeD left, GorgonRangeD right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeD | left | The left range. |
GorgonRangeD | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the operator. |