Class Point
A Point is a 0-dimensional geometry and represents a single location in 2D coordinate space. A Point has a x coordinate value and a y-coordinate value. The boundary of a Point is the empty set.
Inherited Members
Namespace: Mapsui.Geometries
Assembly: Mapsui.Geometries.dll
Syntax
public class Point : Geometry, IGeometry, IEquatable<Geometry>, IComparable<Point>
Constructors
| Improve this Doc View SourcePoint()
Initializes a new empty Point
Declaration
public Point()
Point(Double, Double)
Initializes a new Point
Declaration
public Point(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | X coordinate |
System.Double | y | Y coordinate |
Point(Double[])
Create a new point by a douuble[] array
Declaration
public Point(double[] point)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | point |
Properties
| Improve this Doc View SourceBoundingBox
The minimum bounding box for this Geometry.
Declaration
public override BoundingBox BoundingBox { get; }
Property Value
Type | Description |
---|---|
BoundingBox |
Overrides
| Improve this Doc View SourceItem[UInt32]
Returns part of coordinate. Index 0 = X, Index 1 = Y
Declaration
public virtual double this[uint index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index |
Property Value
Type | Description |
---|---|
System.Double |
NumOrdinates
Returns the number of ordinates for this point
Declaration
public virtual int NumOrdinates { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SetIsEmpty
Sets whether this object is empty
Declaration
protected bool SetIsEmpty { set; }
Property Value
Type | Description |
---|---|
System.Boolean |
X
Gets or sets the X coordinate of the point
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Y
Gets or sets the Y coordinate of the point
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceAsPoint()
Returns a 2D Point instance from this
Declaration
public Point AsPoint()
Returns
Type | Description |
---|---|
Point | Point |
Clone()
This method must be overridden using 'public new [derived_data_type] Clone()'
Declaration
public Point Clone()
Returns
Type | Description |
---|---|
Point | Clone |
CompareTo(Point)
Comparator used for ordering point first by ascending X, then by ascending Y.
Declaration
public virtual int CompareTo(Point other)
Parameters
Type | Name | Description |
---|---|---|
Point | other |
Returns
Type | Description |
---|---|
System.Int32 |
Contains(Point)
Declaration
public override bool Contains(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceDistance(BoundingBox)
Returns the distance between this point and a BoundingBox
Declaration
public double Distance(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box |
Returns
Type | Description |
---|---|
System.Double |
Distance(Point)
Returns the distance between this geometry instance and another geometry, as measured in the spatial reference system of this instance.
Declaration
public override double Distance(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point |
Returns
Type | Description |
---|---|
System.Double |
Overrides
| Improve this Doc View SourceEquals(Geometry)
Declaration
public override bool Equals(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceEquals(Point)
Checks whether this instance is spatially equal to the Point 'o'
Declaration
public virtual bool Equals(Point p)
Parameters
Type | Name | Description |
---|---|---|
Point | p | Point to compare to |
Returns
Type | Description |
---|---|
System.Boolean |
FromDMS(Double, Double, Double, Double, Double, Double)
Returns a point based on degrees, minutes and seconds notation. For western or southern coordinates, add minus '-' in front of all longitude and/or latitude values
Declaration
public static Point FromDMS(double longDegrees, double longMinutes, double longSeconds, double latDegrees, double latMinutes, double latSeconds)
Parameters
Type | Name | Description |
---|---|---|
System.Double | longDegrees | Longitude degrees |
System.Double | longMinutes | Longitude minutes |
System.Double | longSeconds | Longitude seconds |
System.Double | latDegrees | Latitude degrees |
System.Double | latMinutes | Latitude minutes |
System.Double | latSeconds | Latitude seconds |
Returns
Type | Description |
---|---|
Point | Point |
GetHashCode()
Serves as a hash function for a particular type. GetHashCode() is suitable for use in hashing algorithms and data structures like a hash table.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current GetHashCode(). |
Overrides
| Improve this Doc View SourceIsEmpty()
If true, then this Geometry represents the empty point set, Ø, for the coordinate space.
Declaration
public override bool IsEmpty()
Returns
Type | Description |
---|---|
System.Boolean | Returns 'true' if this Geometry is the empty geometry |
Overrides
| Improve this Doc View SourceOffset(Double, Double)
Calculates a new point by translating this point by the specified offset
Declaration
public Point Offset(double offsetX, double offsetY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | offsetX | Offset to translate in X axis |
System.Double | offsetY | Offset to translate in Y axis |
Returns
Type | Description |
---|---|
Point | Returns the offset point |
Rotate(Double, Point)
Calculates a new point by rotating this point clockwise about the specified center point
Declaration
public Point Rotate(double degrees, Point center)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Angle to rotate clockwise (degrees) |
Point | center | Point about which to rotate |
Returns
Type | Description |
---|---|
Point | Returns the rotated point |
Rotate(Double, Double, Double)
Calculates a new point by rotating this point clockwise about the specified center point
Declaration
public Point Rotate(double degrees, double centerX, double centerY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees | Angle to rotate clockwise (degrees) |
System.Double | centerX | X coordinate of point about which to rotate |
System.Double | centerY | Y coordinate of point about which to rotate |
Returns
Type | Description |
---|---|
Point | Returns the rotated point |
ToDoubleArray()
exports a point into a 2-dimensional double array
Declaration
public double[] ToDoubleArray()
Returns
Type | Description |
---|---|
System.Double[] |
Operators
| Improve this Doc View SourceAddition(Point, Point)
Vector + Vector
Declaration
public static Point operator +(Point v1, Point v2)
Parameters
Type | Name | Description |
---|---|---|
Point | v1 | Vector |
Point | v2 | Vector |
Returns
Type | Description |
---|---|
Point |
Multiply(Point, Double)
Vector * Scalar
Declaration
public static Point operator *(Point m, double d)
Parameters
Type | Name | Description |
---|---|---|
Point | m | Vector |
System.Double | d | Scalar (double) |
Returns
Type | Description |
---|---|
Point |
Subtraction(Point, Point)
Vector - Vector
Declaration
public static Point operator -(Point v1, Point v2)
Parameters
Type | Name | Description |
---|---|---|
Point | v1 | Vector |
Point | v2 | Vector |
Returns
Type | Description |
---|---|
Point | Cross product |