Struct Point
Structure defining a point in three-dimensional euclidean space.
Implements
Namespace: BRIDGES.Geometry.Euclidean3D
Assembly: BRIDGES.dll
Syntax
public struct Point : IAddable<Point>, IDotProduct<Point, double>, INorm<Point>, IMetric<Point>, IGroupAction<Point, double>
Constructors
| Improve this Doc View SourcePoint(Point)
Declaration
public Point(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Point to deep copy. |
Point(Double, Double, Double)
Initialises a new instance of the Point structure by defining its three coordinates.
Declaration
public Point(double x, double y, double z)
Parameters
Type | Name | Description |
---|---|---|
Double | x | Value of the first coordinate. |
Double | y | Value of the second coordinate. |
Double | z | Value of the third coordinate. |
Point(Double[])
Initialises a new instance of Point structure by defining its coordinates.
Declaration
public Point(double[] coordinates)
Parameters
Type | Name | Description |
---|---|---|
Double[] | coordinates | Value of the coordinates. |
Properties
| Improve this Doc View SourceDimension
Gets the dimension of this Point's euclidean space.
Declaration
public readonly int Dimension { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32]
Gets or sets the value of the coordinate at the given index.
Declaration
public double this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the coordinate to get or set. |
Property Value
Type | Description |
---|---|
Double | The value of the coordinate at the given index. |
X
Gets or sets the first coordinate of this Point.
Declaration
public double X { get; set; }
Property Value
Type | Description |
---|---|
Double |
Y
Gets or sets the second coordinate of this Point.
Declaration
public double Y { get; set; }
Property Value
Type | Description |
---|---|
Double |
Z
Gets or sets the third coordinate of this Point.
Declaration
public double Z { get; set; }
Property Value
Type | Description |
---|---|
Double |
Zero
Gets a new Point with coordinates (0.0, 0.0, 0.0)
.
Declaration
public static readonly Point Zero { get; }
Property Value
Type | Description |
---|---|
Point |
Methods
| Improve this Doc View SourceAdd(Point, Point)
Computes the addition of two Point.
Declaration
public static Point Add(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the addition. |
Point | right | Point for the addition. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the addition. |
Add(Point, Vector)
Declaration
public static Point Add(Point left, Vector right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the addition. |
Vector | right | Vector for the addition. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the addition. |
Add(Vector, Point)
Declaration
public static Point Add(Vector left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Vector | left | Vector for the addition. |
Point | right | Point for the addition. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the addition. |
CrossProduct(Point, Point)
Returns the cross product of two Point.
Declaration
public static Point CrossProduct(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Left Point for the cross product. |
Point | right | Right Point for the cross product. |
Returns
Type | Description |
---|---|
Point |
DistanceTo(Point)
Declaration
public double DistanceTo(Point other)
Parameters
Type | Name | Description |
---|---|---|
Point | other | Point to evaluate the distance to. |
Returns
Type | Description |
---|---|
Double | The value of the distance between the two Point. |
Divide(Point, Double)
Computes the scalar division of a Point with a
Declaration
public static Point Divide(Point operand, double divisor)
Parameters
Type | Name | Description |
---|---|---|
Point | operand | Point to divide. |
Double | divisor |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar division. |
DotProduct(Point, Point)
Computes the dot product of two Point.
Declaration
public static double DotProduct(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the dot product. |
Point | right | Point for the dot product. |
Returns
Type | Description |
---|---|
Double |
Equals(Point)
Declaration
public bool Equals(Point other)
Parameters
Type | Name | Description |
---|---|---|
Point | other | Point to compare with. |
Returns
Type | Description |
---|---|
Boolean | true if the two Point are equal, false otherwise. |
Remarks
Two Point are equal if their coordinates are equal.
Equals(Object)
Structure defining a point in three-dimensional euclidean space.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
GetCoordinates()
Gets the coordinates of this Point.
Declaration
public double[] GetCoordinates()
Returns
Type | Description |
---|---|
Double[] | The array representation of the Point's coordinates. |
GetHashCode()
Structure defining a point in three-dimensional euclidean space.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Multiply(Point, Double)
Computes the right scalar multiplication of a Point with a
Declaration
public static Point Multiply(Point operand, double factor)
Parameters
Type | Name | Description |
---|---|---|
Point | operand | Point to multiply. |
Double | factor |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar multiplication. |
Multiply(Double, Point)
Computes the left scalar multiplication of a Point with a
Declaration
public static Point Multiply(double factor, Point operand)
Parameters
Type | Name | Description |
---|---|---|
Double | factor | |
Point | operand | Point to multiply. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar multiplication. |
Norm()
Computes the L2-norm this Point.
Declaration
public double Norm()
Returns
Type | Description |
---|---|
Double | The value of the norm. |
SquaredNorm()
Computes the L2-norm this Point.
Declaration
public double SquaredNorm()
Returns
Type | Description |
---|---|
Double | The value of the norm. |
Subtract(Point, Point)
Computes the subtraction of two Point.
Declaration
public static Point Subtract(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point to subtract. |
Point | right | Point to subtract with. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the subtraction. |
Subtract(Point, Vector)
Declaration
public static Point Subtract(Point left, Vector right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point to subtract. |
Vector | right | Vector to subtract with. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the subtraction. |
Subtract(Vector, Point)
Declaration
public static Point Subtract(Vector left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Vector | left | Vector to subtract. |
Point | right | Point to subtract with. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the subtraction. |
ToString()
Structure defining a point in three-dimensional euclidean space.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Operators
| Improve this Doc View SourceAddition(Point, Point)
Computes the addition of two Point.
Declaration
public static Point operator +(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the addition. |
Point | right | Point for the addition. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the addition. |
Addition(Point, Vector)
Declaration
public static Point operator +(Point left, Vector right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the addition. |
Vector | right | Vector for the addition. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the addition. |
Division(Point, Double)
Computes the scalar division of a Point with a
Declaration
public static Point operator /(Point operand, double divisor)
Parameters
Type | Name | Description |
---|---|---|
Point | operand | Point to divide. |
Double | divisor |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar division. |
Explicit(Point to Point)
Declaration
public static explicit operator Point(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | Point to convert. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the conversion. |
Implicit(Vector to Point)
Declaration
public static implicit operator Point(Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Vector | vector | Vector to convert. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the conversion. |
Multiply(Point, Point)
Computes the dot product of two Point.
Declaration
public static double operator *(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point for the dot product. |
Point | right | Point for the dot product. |
Returns
Type | Description |
---|---|
Double |
Multiply(Point, Double)
Computes the right scalar multiplication of a Point with a
Declaration
public static Point operator *(Point operand, double factor)
Parameters
Type | Name | Description |
---|---|---|
Point | operand | Point to multiply. |
Double | factor |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar multiplication. |
Multiply(Double, Point)
Computes the left scalar multiplication of a Point with a
Declaration
public static Point operator *(double factor, Point operand)
Parameters
Type | Name | Description |
---|---|---|
Double | factor | |
Point | operand | Point to multiply. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the scalar multiplication. |
Subtraction(Point, Point)
Computes the subtraction of two Point.
Declaration
public static Point operator -(Point left, Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point to subtract. |
Point | right | Point to subtract with. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the subtraction. |
Subtraction(Point, Vector)
Declaration
public static Point operator -(Point left, Vector right)
Parameters
Type | Name | Description |
---|---|---|
Point | left | Point to subtract. |
Vector | right | Vector to subtract with. |
Returns
Type | Description |
---|---|
Point | The new Point resulting from the subtraction. |
UnaryNegation(Point)
Computes the opposite of the given Point.
Declaration
public static Point operator -(Point operand)
Parameters
Type | Name | Description |
---|---|---|
Point | operand | Point to be opposed. |
Returns
Type | Description |
---|---|
Point | The new Point, opposite of the initial one. |
Explicit Interface Implementations
| Improve this Doc View SourceIAddable<Point>.Add(Point)
Computes the addition of the current element with another element on the right.
Declaration
Point IAddable<Point>.Add(Point right)
Parameters
Type | Name | Description |
---|---|---|
Point | right |
Returns
Type | Description |
---|---|
Point | The new element resulting from the addition. |
IDotProduct<Point, Double>.DotProduct(Point)
Computes the dot product of this element with another element.
Declaration
double IDotProduct<Point, double>.DotProduct(Point other)
Parameters
Type | Name | Description |
---|---|---|
Point | other |
Returns
Type | Description |
---|---|
Double | The value of the dot product of the two elements. |
IGroupAction<Point, Double>.Divide(Double)
Computes the right scalar division of the current element.
Declaration
Point IGroupAction<Point, double>.Divide(double divisor)
Parameters
Type | Name | Description |
---|---|---|
Double | divisor |
Returns
Type | Description |
---|---|
Point | The new element resulting from the scalar dividion. |
IGroupAction<Point, Double>.Multiply(Double)
Computes the right scalar multiplication of the current element.
Declaration
Point IGroupAction<Point, double>.Multiply(double factor)
Parameters
Type | Name | Description |
---|---|---|
Double | factor |
Returns
Type | Description |
---|---|
Point | The new element resulting from the scalar multiplication. |