Struct Point2d
Point 2D struct type for handling of a 2-dimensional point
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 |
---|---|---|
System.Double | pointX | Value of the X coordinate of the new point |
System.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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|---|
System.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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.Boolean | 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 |
---|---|
System.Boolean | 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 |
---|---|---|
System.Object | obj | The object to compare to "this" |
Returns
Type | Description |
---|---|
System.Boolean | bool - true if the object is an instance of Point2D and if it's equal to "this" |
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 |
---|---|
System.Int32 | int - the HashCode for this Point2d |
Operators
View SourceEquality(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 |
---|---|
System.Boolean | True if points are == to each other |
Inequality(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 |
---|---|
System.Boolean | True if points are != to each other |