Point2d
Represents the two coordinates of a point in two-dimensional space, using Double-precision floating point numbers.
Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
[SerializableAttribute]public struct Point2d : ISerializable, IEquatable<Point2d>, IComparable<Point2d>, IComparable, IEpsilonComparable<Point2d>, IFormattable
The Point2d type exposes the following members.
Constructors
Name
Description
Public Method
Point2d(Point2d)
Initializes a new instance of Point2d by copying another Point2d.
Public Method
Point2d(Point3d)
Initializes a new instance of Point3d by copying the first two coordinates of a Point3d.
Public Method
Point2d(Vector2d)
Initializes a new instance of Point2d by converting a vector.
Public Method
Point2d(Double, Double)
Initializes a new instance of Point2d from coordinates.
Properties
Name
Description
Public Property
IsValid
If any coordinate of a point is UnsetValue, then the point is not valid.
Public Property
Item
Accesses the coordinates of this point.
Public Property
MaximumCoordinate
Gets the largest valid coordinate, or RhinoMath.UnsetValue if no coordinate is valid.
Public Property
MinimumCoordinate
Gets the smallest (both positive and negative) valid coordinate, or RhinoMath.UnsetValue if no coordinate is valid.
Public Property
Static Member
Origin
Gets a point at 0,0.
Public Property
Static Member
Unset
Gets a point at RhinoMath.UnsetValue,RhinoMath.UnsetValue.
Public Property
X
Gets or sets the X (first) coordinate of the point.
Public Property
Y
Gets or sets the Y (second) coordinate of the point.
Methods
Name
Description
Public Method
Static Member
Add(Point2d, Point2d)
Adds a point with a point.
(Provided for languages that do not support operator overloading. You can use the + operator otherwise)
Public Method
Static Member
Add(Point2d, Vector2d)
Adds a point with a vector.
(Provided for languages that do not support operator overloading. You can use the + operator otherwise)
Public Method
Static Member
Add(Vector2d, Point2d)
Adds a vector with a point.
(Provided for languages that do not support operator overloading. You can use the + operator otherwise)
Public Method
CompareTo
Compares this Point2d with another Point2d.
Coordinates evaluation priority is first X, then Y.
Public Method
Code Example
DistanceTo
Computes the distance between two points.
Public Method
DistanceToSquared
Computes the square of the distance between two 2d points.
This method is usually largely faster than DistanceTo().
Public Method
Static Member
Divide
Divides a Point2d by a number.
(Provided for languages that do not support operator overloading. You can use the / operator otherwise)
Public Method
EpsilonEquals
Check that all values in other are within epsilon of the values in this
Public Method
Equals(Object)
Determines whether the specified System.Object is a Point2d and has the same values as the present point.
(Overrides ValueType.Equals(Object).)
Public Method
Equals(Point2d)
Determines whether the specified Point2d has the same values as the present point.
Public Method
GetHashCode
Computes a hash number that represents the current point.
(Overrides ValueType.GetHashCode..)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
Static Member
Multiply(Double, Point2d)
Multiplies a Point2d by a number.
(Provided for languages that do not support operator overloading. You can use the * operator otherwise)
Public Method
Static Member
Multiply(Point2d, Double)
Multiplies a Point2d by a number.
(Provided for languages that do not support operator overloading. You can use the * operator otherwise)
Public Method
Static Member
Subtract(Point2d, Point2d)
Subtracts the second point from the first point.
(Provided for languages that do not support operator overloading. You can use the - operator otherwise)
Public Method
Static Member
Subtract(Point2d, Vector2d)
Subtracts a vector from a point.
(Provided for languages that do not support operator overloading. You can use the - operator otherwise)
Public Method
ToString.
Constructs the string representation for the current point.
(Overrides ValueType.ToString..)
Public Method
ToString(String, IFormatProvider)
Formats the value of the current instance using the specified format.
Public Method
Transform
Transforms the present point in place. The transformation matrix acts on the left of the point. i.e.,
result = transformation*point
Operators
Name
Description
Public Operator
Static Member
Addition(Point2d, Point2d)
Adds a point with a point.
Public Operator
Static Member
Addition(Point2d, Vector2d)
Adds a point with a vector.
Public Operator
Static Member
Addition(Vector2d, Point2d)
Adds a vector with a point.
Public Operator
Static Member
Division
Divides a Point2d by a number.
Public Operator
Static Member
Equality
Determines whether two Point2d have equal values.
Public Operator
Static Member
GreaterThan
Determines whether the first specified Point2d comes after (has superior sorting value than) the second point.
Coordinates evaluation priority is first X, then Y.
Public Operator
Static Member
GreaterThanOrEqual
Determines whether the first specified Point2d comes after (has superior sorting value than) the second point, or it is equal to it.
Coordinates evaluation priority is first X, then Y.
Public Operator
Static Member
Inequality
Determines whether two Point2d have different values.
Public Operator
Static Member
LessThan
Determines whether the first specified point comes before (has inferior sorting value than) the second point.
Coordinates evaluation priority is first X, then Y.
Public Operator
Static Member
LessThanOrEqual
Determines whether the first specified point comes before (has inferior sorting value than) the second point, or it is equal to it.
Coordinates evaluation priority is first X, then Y.
Public Operator
Static Member
Multiply(Double, Point2d)
Multiplies a Point2d by a number.
Public Operator
Static Member
Multiply(Point2d, Double)
Multiplies a Point2d by a number.
Public Operator
Static Member
Subtraction(Point2d, Point2d)
Subtracts point2 from point1.
Public Operator
Static Member
Subtraction(Point2d, Vector2d)
Subtracts a vector from a point.