Namespaces

Types in MathNet.Spatial.Euclidean

Type Point2D

Namespace MathNet.Spatial.Euclidean

Parent ValueType

Interfaces IXmlSerializable, IEquatable<Point2D>, IFormattable

Represents a point in 2 dimensional space

Constructors

Static Functions

Methods

Properties

Fields

Public Constructors

Point2D(Double[] data)

Initializes a new instance of the Point2D struct. Creates a point from a list of coordinates (x, y)
Obsolete: This constructor will be removed. Made obsolete 2017-12-03.
Parameters
Double[] data

a pair of coordinates in the order x, y

Point2D(double r, Angle a)

Initializes a new instance of the Point2D struct. Creates a point r from origin rotated a counterclockwise from X-Axis
Obsolete: This constructor will be removed, use FromPolar. Made obsolete 2017-12-03.
Parameters
double r

distance from origin

Angle a

the angle

Point2D(double x, double y)

Initializes a new instance of the Point2D struct. Creates a point for given coordinates (x, y)
Parameters
double x

The x coordinate

double y

The y coordinate

Point2D(IEnumerable<double> data)

Initializes a new instance of the Point2D struct. Creates a point from a list of coordinates (x, y)
Obsolete: This constructor will be removed. Made obsolete 2017-12-03.
Parameters
IEnumerable<double> data

a pair of coordinates in the order x, y

Public Static Functions

Point2D Centroid(IEnumerable<Point2D> points)

Returns the centeroid or center of mass of any set of points
Parameters
IEnumerable<Point2D> points

a list of points

Return
Point2D

the centeroid point

Point2D Centroid(Point2D[] points)

Returns the centeroid or center of mass of any set of points
Parameters
Point2D[] points

a list of points

Return
Point2D

the centeroid point

Point2D FromPolar(double radius, Angle angle)

Initializes a new instance of the Point2D struct. Creates a point r from origin rotated a counterclockwise from X-Axis
Parameters
double radius

distance from origin

Angle angle

the angle

Return
Point2D

The Point2D

Point2D MidPoint(Point2D point1, Point2D point2)

Returns a point midway between the provided points point1 and point2
Parameters
Point2D point1

point A

Point2D point2

point B

Return
Point2D

a new point midway between the provided points

Point2D OfVector(Vector<double> vector)

Create a new Point2D from a Math.NET Numerics vector of length 2.
Parameters
Vector<double> vector

A vector with length 2 to populate the created instance with.

Return
Point2D

A Point2D

Point2D Parse(string value, IFormatProvider formatProvider)

Attempts to convert a string of the form x,y into a point
Parameters
string value

The string to be converted

IFormatProvider formatProvider

The IFormatProvider

Return
Point2D

A point at the coordinates specified

Point2D ReadFrom(XmlReader reader)

Creates an Point2D from an XmlReader.
Parameters
XmlReader reader

An XmlReader positioned at the node to read into this Point2D.

Return
Point2D

An Point2D that contains the data read from the reader.

bool TryParse(string text, IFormatProvider formatProvider, Point2D& result)

bool TryParse(string text, Point2D& result)

Public Methods

double DistanceTo(Point2D otherPoint)

Finds the straight line distance to another point
Parameters
Point2D otherPoint

The other point

Return
double

a distance measure

bool Equals(object obj)

bool Equals(Point2D other)

bool Equals(Point2D other, double tolerance)

Returns a value to indicate if a pair of points are equal
Parameters
Point2D other

The point to compare against.

double tolerance

A tolerance (epsilon) to adjust for floating point error

Return
bool

true if the points are equal; otherwise false

int GetHashCode()

Type GetType()

Point3D ToPoint3D()

return new Point3D(X, Y, 0);
Obsolete: Use projections instead, Obsolete on 2017-12-10
Return
Point3D

A Point3D with x and y from this instance and z = 0

string ToString(string format, IFormatProvider provider)

string ToString()

string ToString(IFormatProvider provider)

Returns a string representation of this instance using the provided IFormatProvider
Parameters
IFormatProvider provider

A IFormatProvider

Return
string

The string representation of this instance.

Vector<double> ToVector()

Convert to a Math.NET Numerics dense vector of length 2.
Return
Vector<double>

A Vector`1 with the x and y values from this instance.

Vector2D ToVector2D()

Converts this point into a vector from the origin
Return
Vector2D

A vector equivalent to this point

Point3D TransformBy(CoordinateSystem cs)

Applies a transform coordinate system to the point
Obsolete: Use projections instead, Obsolete on 2017-12-10
Parameters
CoordinateSystem cs

A coordinate system

Return
Point3D

A new 3D point

Point2D TransformBy(Matrix<double> m)

Applies a transform matrix to the point
Parameters
Matrix<double> m

A transform matrix

Return
Point2D

A new point

Vector2D VectorTo(Point2D otherPoint)

Gets a vector from this point to another point
Parameters
Point2D otherPoint

The point to which the vector should go

Return
Vector2D

A vector pointing to the other point.

Public Properties

Point2D Origin get;

Gets a point at the origin (0,0)

Public fields

double X

The x coordinate
return double

double Y

The y coordinate
return double