Struct Point2d
Point 2D struct type for handling of a 2-dimensional point
Inherited Members
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Point2d
Constructors
View SourcePoint2d(double, double)
Create a 2D point; X and Y
Declaration
public Point2d(double pointX, double pointY)
Parameters
| Type | Name | Description |
|---|---|---|
| double | pointX | Value of the X coordinate of the new point |
| double | pointY | Value of the Y coordinate of the new point |
Properties
View SourceX
Property to access the X component of the point
Declaration
public double X { get; set; }
Property Value
| Type | Description |
|---|---|
| double | X value of the 2D point |
Y
Property to access the Y component of the point
Declaration
public double Y { get; set; }
Property Value
| Type | Description |
|---|---|
| double | Y value of the 2D point |
Methods
View SourceAngleTo(Point2d)
Returns a double equivalent to the angle between two 2D points along X-axis
Declaration
public double AngleTo(Point2d point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point | Point to calculate angle to |
Returns
| Type | Description |
|---|---|
| double | Angle (degrees) between the two points |
AngleToAsAngle(Point2d)
Returns a Angle type equivalent to the angle between two 2D points along X-axis
Declaration
public Angle AngleToAsAngle(Point2d point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point | Point to calculate angle to |
Returns
| Type | Description |
|---|---|
| Angle | Angle (degrees) between the two points |
As3d()
Convert to a Point3d
Declaration
public Point3d As3d()
Returns
| Type | Description |
|---|---|
| Point3d | 3D Point |
Remarks
Z value will be set to 0
As3d(double)
Convert to a Point3d
Declaration
public Point3d As3d(double z)
Parameters
| Type | Name | Description |
|---|---|---|
| double | z | Value of Z in the Point3d |
Returns
| Type | Description |
|---|---|
| Point3d | 3D Point |
DistanceBetween(Point2d, Point2d)
Calculate distance between two points
Declaration
public static double DistanceBetween(Point2d point1, Point2d point2)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point1 | First point |
| Point2d | point2 | Second point |
Returns
| Type | Description |
|---|---|
| double | Distance between points passed |
DistanceTo(Point2d)
Returns a double equivalent to the Euclidean distance between the two points
Declaration
public double DistanceTo(Point2d point)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point | Point to calculate distance to |
Returns
| Type | Description |
|---|---|
| double | Distance between the two points |
Equals(Point2d)
Equals - compares this Point2D with the passed in object. In this equality Double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail
Declaration
public bool Equals(Point2d point2d)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point2d | The Point2d to compare to "this" |
Returns
| Type | Description |
|---|---|
| bool | bool - true if "value" is equal to "this" |
Equals(Point2d, Point2d)
Compares two Point2D instances for object equality. In this equality Double.NaN is equal to itself, unlike in numeric equality
Declaration
public static bool Equals(Point2d point1, Point2d point2)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point1 | The first Point2d to compare |
| Point2d | point2 | The second Point2d to compare |
Returns
| Type | Description |
|---|---|
| bool | bool - true if the two Point2D instances are exactly equal, false otherwise |
Remarks
Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail
Equals(object)
Equals - compares this Point2D with the passed in object. In this equality Double.NaN is equal to itself, unlike in numeric equality
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare to "this" |
Returns
| Type | Description |
|---|---|
| bool | bool - true if the object is an instance of Point2D and if it's equal to "this" |
Overrides
Remarks
Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail
GetHashCode()
Returns the HashCode for this Point2d
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | int - the HashCode for this Point2d |
Overrides
Operators
View Sourceoperator ==(Point2d, Point2d)
Declaration
public static bool operator ==(Point2d point1, Point2d point2)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point1 | First point |
| Point2d | point2 | Second point |
Returns
| Type | Description |
|---|---|
| bool | True if points are == to each other |
operator !=(Point2d, Point2d)
Declaration
public static bool operator !=(Point2d point1, Point2d point2)
Parameters
| Type | Name | Description |
|---|---|---|
| Point2d | point1 | First point |
| Point2d | point2 | Second point |
Returns
| Type | Description |
|---|---|
| bool | True if points are != to each other |