Show / Hide Table of Contents

Struct Point3d

Point 3D struct type for handling of a 3-dimensional point

Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public struct Point3d

Constructors

View Source

Point3d(Double, Double, Double)

Create a 3D vector passing the three components; X, Y and Z

Declaration
public Point3d(double pointX, double pointY, double pointZ)
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

System.Double pointZ

Value of the Z coordinate of the new point

Properties

View Source

X

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 3D point

View Source

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 3D point

View Source

Z

Property to access the Z component of the point

Declaration
public double Z { get; set; }
Property Value
Type Description
System.Double

Z value of the 3D point

Methods

View Source

As2d()

Return the 2D point

Declaration
public Point2d As2d()
Returns
Type Description
Point2d

2D Point

Remarks

Ignoring Z componet of Point3D

View Source

Distance2dBetween(Point3d, Point3d)

Return 2D distance between 2 points

Declaration
public static double Distance2dBetween(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

First point

Point3d point2

Second point

Returns
Type Description
System.Double

Distance 2D between the two points

View Source

Distance2dTo(Point3d)

Distance2dTo - Calculate distance to a point using X and Y coordinates, 2D

Declaration
public double Distance2dTo(Point3d point)
Parameters
Type Name Description
Point3d point

point to calculate the 2D distance to

Returns
Type Description
System.Double

Distance between current point and passed point

View Source

DistanceBetween(Point3d, Point3d)

DistanceBetween - Calculate distance between two points

Declaration
public static double DistanceBetween(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

First point

Point3d point2

Second point

Returns
Type Description
System.Double

Distance between points passed

View Source

DistanceTo(Point3d)

DistanceTo - Calculate distance to a point

Declaration
public double DistanceTo(Point3d point)
Parameters
Type Name Description
Point3d point

point to calculate distance to

Returns
Type Description
System.Double

Distance between current point and passed point

View Source

Equals(Point3d)

Equals - compares this Point3D 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(Point3d point3d)
Parameters
Type Name Description
Point3d point3d

The Point3d to compare to "this"

Returns
Type Description
System.Boolean

bool - true if "value" is equal to "this"

View Source

Equals(Point3d, Point3d)

Compares two Point3D instances for object equality. In this equality Double.NaN is equal to itself, unlike in numeric equality

Declaration
public static bool Equals(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

The first Point3d to compare

Point3d point2

The second Point3d to compare

Returns
Type Description
System.Boolean

bool - true if the two Point3D 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

View Source

Equals(Object)

Equals - compares this Point3D 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 Point3D 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

View Source

GetHashCode()

Returns the HashCode for this Point3d

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

int - the HashCode for this Point3d

View Source

GetMirror(Axes)

Mirrors a point around an axis

Declaration
public Point3d GetMirror(Axes axis)
Parameters
Type Name Description
Axes axis

Axis to mirror point around

Returns
Type Description
Point3d

Returns the mirrored point

Remarks

Leaves existing object the same value

View Source

GetTranslated(Double, Angle)

Translates the existing Point3D structure by the specified offset along the vector

Declaration
public Point3d GetTranslated(double offset, Angle cartesianAngle)
Parameters
Type Name Description
System.Double offset

distance to translate along the angle

Angle cartesianAngle

Angle to offset from with x-axis being 0 degrees (cartesian)

Returns
Type Description
Point3d

Point3d - New translated point

Remarks

Leaves existing object the same value

View Source

GetTranslated(Double, CompassBearing)

Translates the existing Point3D structure by the specified amounts

Declaration
public Point3d GetTranslated(double offset, CompassBearing compassBearing)
Parameters
Type Name Description
System.Double offset

distance to translate along the compass bearing

CompassBearing compassBearing

Bearing to offset from with y-axis being 0 degrees (Compass North)

Returns
Type Description
Point3d

Point3d - New translated point

Remarks

Leaves existing object the same value

View Source

GetTranslated(Double, Vector3d)

Translates the existing Point3D structure by the specified offset along the vector

Declaration
public Point3d GetTranslated(double offset, Vector3d vector3d)
Parameters
Type Name Description
System.Double offset

distance to translate

Vector3d vector3d

direction to translate

Returns
Type Description
Point3d

Point3d - New translated point

Remarks

Leaves existing object the same value

View Source

GetTranslated(Double, Double)

Translates the Point3D structure by the specified amounts

Declaration
public Point3d GetTranslated(double deltaX, double deltaY)
Parameters
Type Name Description
System.Double deltaX

distance in the X-axis

System.Double deltaY

distance in the Y-axis

Returns
Type Description
Point3d

Returns the translated point

Remarks

Leaves existing object the same value

View Source

Offset(Double, Double, Double)

Offset - update point position by adding offsetX to X, offsetY to Y, and offsetZ to Z

Declaration
public void Offset(double offsetX, double offsetY, double offsetZ)
Parameters
Type Name Description
System.Double offsetX

Offset in the X direction

System.Double offsetY

Offset in the Y direction

System.Double offsetZ

Offset in the Z direction

View Source

PointBetween(Point3d, Double)

Return a point between 2 points at give t(0~1) from point 1. x = x1 + t * (x2 - x1), etc.

Declaration
public Point3d PointBetween(Point3d point2, double t01)
Parameters
Type Name Description
Point3d point2

Second point

System.Double t01

At t-coord from point1

Returns
Type Description
Point3d

Point3d - Calculated point between two points

View Source

Rotate2DByAngle(Angle)

Rotate point around Z-Axis with 0,0,0 as the origin

Declaration
public Point3d Rotate2DByAngle(Angle angle)
Parameters
Type Name Description
Angle angle

Rotaton angle using Angle class

Returns
Type Description
Point3d

Rotated point

Remarks

Point will be rotated anti clockwise

View Source

Rotate2DByDegrees(Double)

Rotate point around Z-Axis with 0,0,0 as the origin

Declaration
public Point3d Rotate2DByDegrees(double degrees)
Parameters
Type Name Description
System.Double degrees

Angle in degrees that the point with be rotated

Returns
Type Description
Point3d

Rotated point

Remarks

Point will be rotated anti clockwise

View Source

Rotate2DByRadians(Double)

Rotate point around Z-Axis with 0,0,0 as the origin

Declaration
public Point3d Rotate2DByRadians(double radians)
Parameters
Type Name Description
System.Double radians

Angle in radians that the point with be rotated

Returns
Type Description
Point3d

Rotated point

Remarks

Point will be rotated anti clockwise

View Source

Subtract(Point3d, Point3d)

Subtraction of two Point3d variables to Vector3d

Declaration
public static Vector3d Subtract(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

Point from which we are subtracting the second point

Point3d point2

Point being subtracted

Returns
Type Description
Vector3d

Vector between the two points

View Source

Subtract(Point3d, Vector3d)

Point3D - Vector3D subtraction

Declaration
public static Point3d Subtract(Point3d point, Vector3d vector)
Parameters
Type Name Description
Point3d point

Point from which vector is being subtracted

Vector3d vector

Vector being subtracted from the point

Returns
Type Description
Point3d

Result of subtraction

View Source

Subtract(Vector3d, Point3d)

Vector3D - Point3Dsubtraction

Declaration
public static Point3d Subtract(Vector3d vector, Point3d point)
Parameters
Type Name Description
Vector3d vector

Vector from which point is being subtracted

Point3d point

Point being subtracted from the vector

Returns
Type Description
Point3d

Result of subtraction

View Source

ToString()

Return a string of the point

Declaration
public override string ToString()
Returns
Type Description
System.String

string: X,Y,Z

View Source

ToString(IFormatProvider)

String with the current culture number format

Declaration
public string ToString(IFormatProvider iFormatProvider)
Parameters
Type Name Description
IFormatProvider iFormatProvider

IFormatProvider

Returns
Type Description
System.String

string containing Point3d numbers is culture format

View Source

Translate(Double, Angle)

Translates the existing Point3D structure by the specified amounts

Declaration
public void Translate(double offset, Angle cartesianAngle)
Parameters
Type Name Description
System.Double offset

distance to translate along the angle

Angle cartesianAngle

Angle to offset from with x-axis being 0 degrees (cartesian)

Remarks

Existing value in object will be updated

View Source

Translate(Double, CompassBearing)

Translates the existing Point3D structure by the specified amounts

Declaration
public void Translate(double offset, CompassBearing compassBearing)
Parameters
Type Name Description
System.Double offset

distance to translate along the angle

CompassBearing compassBearing

Bearing to offset from with y-axis being 0 degrees (Compass North)

Remarks

Existing value in object will be updated

View Source

Translate(Double, Vector3d)

Translates the existing Point3D structure by the specified offset along the vector

Declaration
public void Translate(double offset, Vector3d vector3d)
Parameters
Type Name Description
System.Double offset

distance to translate

Vector3d vector3d

direction to translate

Remarks

Existing value in object will be updated / Vector will be normalized

View Source

Translate(Double, Double)

Translates the existing Point3D structure by the specified amounts

Declaration
public void Translate(double deltaX, double deltaY)
Parameters
Type Name Description
System.Double deltaX

distance in the X-axis

System.Double deltaY

distance in the Y-axis

Remarks

Existing value in object will be updated

Operators

View Source

Addition(Point3d, Point3d)

Point3D + Point3D addition

Declaration
public static Point3d operator +(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

First Point3d being added

Point3d point2

Second Point3d being added

Returns
Type Description
Point3d

Result of addition

View Source

Addition(Point3d, Vector3d)

Point3D + Vector3D addition

Declaration
public static Point3d operator +(Point3d point, Vector3d vector)
Parameters
Type Name Description
Point3d point

Point being added

Vector3d vector

Vector being added

Returns
Type Description
Point3d

Result of addition

View Source

Equality(Point3d, Point3d)

Declaration
public static bool operator ==(Point3d point3d1, Point3d point3d2)
Parameters
Type Name Description
Point3d point3d1
Point3d point3d2
Returns
Type Description
System.Boolean
View Source

Inequality(Point3d, Point3d)

Declaration
public static bool operator !=(Point3d point3d1, Point3d point3d2)
Parameters
Type Name Description
Point3d point3d1
Point3d point3d2
Returns
Type Description
System.Boolean
View Source

Subtraction(Point3d, Point3d)

Subtraction

Declaration
public static Vector3d operator -(Point3d point1, Point3d point2)
Parameters
Type Name Description
Point3d point1

Point from which we are subtracting the second point

Point3d point2

Point being subtracted

Returns
Type Description
Vector3d

Vector between the two points

View Source

Subtraction(Point3d, Vector3d)

Point3d - Vector3d subtraction

Declaration
public static Point3d operator -(Point3d point, Vector3d vector)
Parameters
Type Name Description
Point3d point

Point from which vector is being subtracted

Vector3d vector

Vector being subtracted from the point

Returns
Type Description
Point3d

Result of subtraction

View Source

Subtraction(Vector3d, Point3d)

Vector3d - Point3dsubtraction

Declaration
public static Point3d operator -(Vector3d vector, Point3d point)
Parameters
Type Name Description
Vector3d vector

Vector from which point is being subtracted

Point3d point

Point being subtracted from the vector

Returns
Type Description
Point3d

Result of subtraction

  • View Source
In This Article
Back to top Copyright 2018-2024 CADology Limited