Struct GeoPoint
A 3-dimensional point with double components. The components are directly accesible to achieve maximum speed.
note
Keep in mind that this is a value type. Passing a value type as a (non ref) parameter and changing it's value inside the invoked method leaves the original unchanged.
Inherited Members
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
[JsonVersion(serializeAsStruct = true, version = 1)]
public struct GeoPoint : ISerializable, IJsonSerialize, IExportStep
Constructors
| Improve this Doc View SourceGeoPoint(GeoPoint, GeoPoint)
Constructs a new GeoPoint in the middle between two other GeoPoints
Declaration
public GeoPoint(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | first point |
| GeoPoint | p2 | second point |
GeoPoint(GeoPoint, GeoPoint, Double)
Declaration
public GeoPoint(GeoPoint p1, GeoPoint p2, double ratio)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | |
| GeoPoint | p2 | |
| System.Double | ratio |
GeoPoint(GeoPoint, Double, Double, Double)
Constructs a new GeoPoint as on offset from an existing GeoPoint.
Declaration
public GeoPoint(GeoPoint StartWith, double OffsetX, double OffsetY, double OffsetZ)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | StartWith | from here |
| System.Double | OffsetX | x-offset |
| System.Double | OffsetY | y-offset |
| System.Double | OffsetZ | z-offset |
GeoPoint(GeoPoint[])
Constructs a ne GeoPoint at the geometric middle of the provided points
Declaration
public GeoPoint(params GeoPoint[] p)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint[] | p |
GeoPoint(GeoPoint2D)
Creates a GeoPoint with the z-coordinate 0.0 and x,y set to p.x,p.y
Declaration
public GeoPoint(GeoPoint2D p)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint2D | p | two dimensional point in the x/y Plane |
GeoPoint(GeoPoint2D, Double)
Declaration
public GeoPoint(GeoPoint2D p, double z)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint2D | p | |
| System.Double | z |
GeoPoint(Vector)
Declaration
public GeoPoint(Vector d)
Parameters
| Type | Name | Description |
|---|---|---|
| MathNet.Numerics.LinearAlgebra.Double.Vector | d |
GeoPoint(Double, Double)
Constructs a new GeoPoint with given x and y components, z-component will be 0.0
Declaration
public GeoPoint(double x, double y)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | x-component |
| System.Double | y | y-component |
GeoPoint(Double, Double, Double)
Constructs a new GeoPoint with given x, y and z components.
Declaration
public GeoPoint(double x, double y, double z)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | x | x-component |
| System.Double | y | y-component |
| System.Double | z | z-component |
GeoPoint(SerializationInfo, StreamingContext)
Constructor for ISerializable
Declaration
public GeoPoint(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | |
| System.Runtime.Serialization.StreamingContext | context |
Fields
| Improve this Doc View Sourcex
x-component
Declaration
public double x
Field Value
| Type | Description |
|---|---|
| System.Double |
y
y-component
Declaration
public double y
Field Value
| Type | Description |
|---|---|
| System.Double |
z
z-component
Declaration
public double z
Field Value
| Type | Description |
|---|---|
| System.Double |
Properties
| Improve this Doc View SourceInvalid
returns new GeoPoint(NaN, NaN, NaN);
Declaration
public static GeoPoint Invalid { get; }
Property Value
| Type | Description |
|---|---|
| GeoPoint |
Item[Int32]
Declaration
public double this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Property Value
| Type | Description |
|---|---|
| System.Double |
Origin
returns the origin, same as new GeoPoint(0.0,0.0,0.0);
Declaration
public static GeoPoint Origin { get; }
Property Value
| Type | Description |
|---|---|
| GeoPoint |
Methods
| Improve this Doc View SourceCenter(GeoPoint[])
Creates a new GeoPoint at the center of the points provided in the parameter list.
Declaration
public static GeoPoint Center(params GeoPoint[] p)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint[] | p | List of points |
Returns
| Type | Description |
|---|---|
| GeoPoint | The geometric center of p |
Distance(GeoPoint)
Returns the distance from this point to the given point.
Declaration
public double Distance(GeoPoint To)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | To | target point |
Returns
| Type | Description |
|---|---|
| System.Double | distance |
Equals(Object)
Overrides object.Equals
Declaration
public override bool Equals(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o | object to compare with |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if equal |
Overrides
GetHashCode()
Overrides object.GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | hashcode |
Overrides
Project(Plane, GeoPoint)
Declaration
public GeoPoint2D Project(Plane plane, GeoPoint center)
Parameters
| Type | Name | Description |
|---|---|---|
| Plane | plane | |
| GeoPoint | center |
Returns
| Type | Description |
|---|---|
| GeoPoint2D |
To2D()
returns a 2-dimensional point by ommiting the z-component.
Declaration
public GeoPoint2D To2D()
Returns
| Type | Description |
|---|---|
| GeoPoint2D |
ToPointF(ModOp)
Returns this point modified by ModOp m as a System.Drawing.PointF
Declaration
public PointF ToPointF(ModOp m)
Parameters
| Type | Name | Description |
|---|---|---|
| ModOp | m | modify by |
Returns
| Type | Description |
|---|---|
| System.Drawing.PointF | modified point |
ToString()
Overrides object.ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | x.ToString()+", "+y.ToString()+", "+z.ToString() |
Overrides
ToVector()
Returns the vector that points from the origin to this point
Declaration
public GeoVector ToVector()
Returns
| Type | Description |
|---|---|
| GeoVector |
Operators
| Improve this Doc View SourceAddition(GeoPoint, GeoVector)
Adds a vector (offset) to a GeoPoint
Declaration
public static GeoPoint operator +(GeoPoint p, GeoVector v)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p | the point |
| GeoVector | v | the vector |
Returns
| Type | Description |
|---|---|
| GeoPoint | offset point |
BitwiseAnd(GeoPoint, GeoPoint)
Declaration
public static double operator &(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | |
| GeoPoint | p2 |
Returns
| Type | Description |
|---|---|
| System.Double |
BitwiseOr(GeoPoint, GeoPoint)
Returns the distance of the two points
Declaration
public static double operator |(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | first point |
| GeoPoint | p2 | second point |
Returns
| Type | Description |
|---|---|
| System.Double | the distance |
Equality(GeoPoint, GeoPoint)
Determins whether two GeoPoints are exactly equal. Use IsEqual(GeoPoint, GeoPoint) if you need more control over precision.
Declaration
public static bool operator ==(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | first point |
| GeoPoint | p2 | secont point |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if equal |
Implicit(GeoPoint to Double[])
Declaration
public static implicit operator double[](GeoPoint p)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p |
Returns
| Type | Description |
|---|---|
| System.Double[] |
Inequality(GeoPoint, GeoPoint)
Determins whether two GeoPoints are not equal. Use IsEqual(GeoPoint, GeoPoint) if you need more control over precision.
Declaration
public static bool operator !=(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | first point |
| GeoPoint | p2 | secont point |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if not equal |
Multiply(Matrix, GeoPoint)
Declaration
public static GeoPoint operator *(Matrix m, GeoPoint p)
Parameters
| Type | Name | Description |
|---|---|---|
| MathNet.Numerics.LinearAlgebra.Double.Matrix | m | |
| GeoPoint | p |
Returns
| Type | Description |
|---|---|
| GeoPoint |
Subtraction(GeoPoint, GeoPoint)
Returns the vector that points from p1 to p2.
Declaration
public static GeoVector operator -(GeoPoint p1, GeoPoint p2)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p1 | first point |
| GeoPoint | p2 | secont point |
Returns
| Type | Description |
|---|---|
| GeoVector | the vector |
Subtraction(GeoPoint, GeoVector)
Subtracts a vector (offset) from a GeoPoint
Declaration
public static GeoPoint operator -(GeoPoint p, GeoVector v)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p | the point |
| GeoVector | v | the vector |
Returns
| Type | Description |
|---|---|
| GeoPoint | offset point |
UnaryNegation(GeoPoint)
Declaration
public static GeoPoint operator -(GeoPoint p)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint | p |
Returns
| Type | Description |
|---|---|
| GeoPoint |
Explicit Interface Implementations
| Improve this Doc View SourceIExportStep.Export(ExportStep, Boolean)
Declaration
int IExportStep.Export(ExportStep export, bool topLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| ExportStep | export | |
| System.Boolean | topLevel |
Returns
| Type | Description |
|---|---|
| System.Int32 |
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonWriteData | data |
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonReadData | data |
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | |
| System.Runtime.Serialization.StreamingContext | context |