Point2d Class

2d point class
Public Class Point2d 
Inherits Geometry2d 
Implements IComparable, _ 
IPosition2d
This language is not supported or no code example is available.
public class Point2d : Geometry2d
IComparable
IPosition2d
This language is not supported or no code example is available.
public ref class Point2d : public Geometry2d^, 
public IComparable^, 
public IPosition2d^
This language is not supported or no code example is available.
public class Point2d 
extends Geometry2d 
implements IComparable
IPosition2d
This language is not supported or no code example is available.
Name Description
Public constructor Point2d() Constructor. Creates a new point at 0,0
Public constructor Point2d(Point2d) Copy constructor.
Public constructor Point2d(Vector2d)
Public constructor Point2d(double, double) Constructor that creates a point at a specified position.
Top
Name Description
Public property Extents Gets the extents of the point.
Public property Item(int) Indexing a point returns x for index 0, and y for index 1. This is to be more compatible with old c-style code.
Public property Static Origo The point (0, 0).
Public property X Gets the x coordinate of the point. The x member of the point is public, but this is to implement the IPosition2d interface.
Public property Static XAxis The point (1, 0).
Public property Y Gets the y coordinate of the point. The x member of the point is public, but this is to implement the IPosition2d interface.
Public property Static YAxis The point (0, 1).
Top
Methods
 
Name Description
Public method Angle(Point2d) Returns an plane angle from this point to another.
Public method Clone()
Public method ClosestPoint(IEnumerable<Point2d>) Returns a reference to the point that is closest to this point or throws an ArgumentException if no points are given.
Public method CompareTo(object) Implements the i comparable interface. The point with the smallest y is the smallest point. If y is same for the points, the one with smallest x is the smallest one. This is suitable for sorting points for sweep algorithms for example.
Public method CompareToX(Point2d)
Public method Distance(Point2d) Computes the distance from this to another point.
Public method Equals(Point2d, double) Checks if this point is about the same as another point with a given tolerance.
Public method Mirror(Point2d, Point2d) Mirrors the point in-place over a reflection line given by two points.
Public method Mirror(Point2d) Mirrors the point over another point. This equals rotating it 180 degrees around the other point, although this is done much faster with this function.
Public method Polar(double, double) Computes a new point with a specified angle and distance from this point.
Public method Rotate(double) Rotates this point in-place around world origo.
Public method Rotate(double, Point2d) Rotates this point in-place around another point.
Public method Scale(double) Scales the point, using world origo as scaling center.
Public method Scale(double, Point2d) Scales the point, using a specified scaling center.
Public method Scale(double, double, Point2d) Scales the point diffrently in x and y, using a specified scaling center.
Public method Side(Point2d, Point2d, double) Check the relative side of a point to a infinite line passing through two given points.
Public method SquaredDistance(Point2d) Returns the suqared distance between this point and another. This is faster than computing the actual distance since it saves a square root calculation.
Public method ToRegion(double) Converts this point to a region representation. A point is represented as a poly with a single point.
Public method ToString() Creates a new string sutiable for debugging purposes.
Public method ToVector() Create a vector (x,y) from the point (x,y).
Public method Transform(Matrix2d) Transforms the point in-place by a matrix.
Public method Translate(double, double) Moves the point a specified delta x and delta y.
Public method WriteAutoCADScript(StreamWriter, int) Writes text to a stream, that can be loaded as a script into autocad.
Top
Name Description
Operator Static Addition Adds a vector to the point giving a new point.
Operator Static Addition
Operator Static GreaterThan Compares two points using the first points IComparable interface.
Operator Static GreaterThanOrEqual Compares two points using the first points IComparable interface.
Operator Static LessThan Compares two points using the first points IComparable interface.
Operator Static LessThanOrEqual Compares two points using the first points IComparable interface.
Operator Static Multiply Multiplies a point with a constant
Operator Static Multiply
Operator Static Subtraction
Operator Static Subtraction Subtracts two points, giving a new vector from point 2 to point 1.
Top
Fields
 
Name Description
Public field x The x component of the point left public for fast access.
Public field y The y component of the point left public for fast access.
Top

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

In this article

Definition