Represents a single immutable n-dimensional point.

Constructors

PointN

#
public PointN(IEnumerable<double> coordinates)
Create a new multi-dimensional point.
coordinates (IEnumerable<double>)Coordinates.

PointN

#
public PointN(params double[] coordinates)
Create a new multi-dimensional point.
coordinates (params double[])Coordinates.

Properties

Description

#
public string Description { get; }
Gets a description of this object type.
Description

Dimensionality

#
public int Dimensionality { get; }
Gets the dimensionality of this object instance.
Dimensionality

IsInfinite

#
public bool IsInfinite { get; }
Gets whether this point is infinite. If the coordinates contain even a single Infinity value, the point is considered to be at infinity. This test is fast.

IsLarge

#
public bool IsLarge { get; }
Gets whether this point contains any coordinates that are considered large enough to be problematic for arithmetical operations. Infinities are not counted as big numbers. This test is fast.

IsNegative

#
public bool IsNegative { get; }
Gets whether this point contains any negative coordinates. Zero is not counted as a negative number. This test is fast.

IsOrigin

#
public bool IsOrigin { get; }
Gets whether this point represents the origin. All coordinates must be exactly equal to zero for a point to be considered the origin. This test is fast.

IsPositive

#
public bool IsPositive { get; }
Gets whether this point contains any positive coordinates. Zero is not counted as a positive number. This test is fast.

IsUnit

#
public bool IsUnit { get; }
Gets whether this point resides on or near the unit hypersphere. This test is fast.

IsUnset

#
public bool IsUnset { get; }
Gets whether this point is unset. If the coordinates contain even a single NaN value, the point is considered to be unset. This test is fast.

IsZero

#
public bool IsZero { get; }
Gets whether this point contains any coordinates that are exactly zero. This test is fast.

Indexers

this[]

#
public double this[int dimension] { get; }
Gets the component of this point for the given axis.
dimension (int)

Methods

CompareTo

#
public int CompareTo(PointN other)
Compare two PointNs for sort order.
other (PointN)

CreateInfinite

#
public static PointN CreateInfinite(int dimensionality, bool positive)
Create a new point of a specific dimensionality at infinity.
dimensionality (int)Dimensionality of point.
positive (bool)If true, point will reside at positive infinity.
Infinity point.

CreateOrigin

#
public static PointN CreateOrigin(int dimensionality)
Create a new origin point of a specific dimensionality.
dimensionality (int)Dimensionality of point.
Origin point.

CreateUnset

#
public static PointN CreateUnset(int dimensionality)
Create a new unset point of a specific dimensionality.
dimensionality (int)Dimensionality of point.
None point.

Distance

#
public double Distance(PointN other)
Compute the distance between two points.
other (PointN)Second point.
Distance.

Equals

#
public override bool Equals(object obj)
Indicates whether this instance and a specified object are equal.
obj (object)The object to compare with the current instance.
true if obj and this instance are the same type and represent the same value; otherwise, false.
ValueType.Equals

Equals

#
public bool Equals(PointN other)
Compare two PointNs for equality.
other (PointN)

GetHashCode

#
public override int GetHashCode()
Returns the hash code for this instance.
A 32-bit signed integer that is the hash code for this instance.

Quadrance

#
public double Quadrance(PointN other)
Compute the quadrance between two points.
other (PointN)Second point.
Quadrance.

ToArray

#
public double[] ToArray()
Convert the coordinates to a double array.

ToString

#
public override string ToString()
Returns the fully qualified type name of this instance.

Operators

OperationResultDescription
PointN+PointNPointNAdd two multi-dimensional points together.
PointN/doublePointNDivide a point by a factor.
PointN*doublePointNMultiply a point by a factor.
PointN-PointNPointNSubtract two multi-dimensional points. If the points do not share their dimensionality, the results will be meaningless and exceptions may be thrown.