Struct GeoPoint2D
A 2-dimensional point with double x and y components.
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.
Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: CADability.dll
Syntax
[Serializable]
[JsonVersion(serializeAsStruct = true, version = 1)]
public struct GeoPoint2D : ISerializable, IJsonSerialize
Constructors
|
Improve this Doc
View Source
GeoPoint2D(GeoPoint2D, GeoPoint2D)
Creates a new GeoPoint2D in the middle of the two given points
Declaration
public GeoPoint2D(GeoPoint2D p1, GeoPoint2D p2)
Parameters
|
Improve this Doc
View Source
GeoPoint2D(GeoPoint2D, GeoPoint2D, Double)
Declaration
public GeoPoint2D(GeoPoint2D p1, GeoPoint2D p2, double ratio)
Parameters
|
Improve this Doc
View Source
GeoPoint2D(GeoPoint2D, Double, Angle)
Creates a new GeoPoint2D at the specified offset to the provided GeoPoint2D c
Declaration
public GeoPoint2D(GeoPoint2D c, double d, Angle a)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
c |
Original point
|
| System.Double |
d |
Distance to the original point
|
| Angle |
a |
Angle to the original point
|
|
Improve this Doc
View Source
GeoPoint2D(GeoPoint2D, Double, Double)
Creates a new GeoPoint2D at the specified offset to the provided GeoPoint2D p
Declaration
public GeoPoint2D(GeoPoint2D p, double x, double y)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
Original point
|
| System.Double |
x |
Offset in x
|
| System.Double |
y |
Offset in y
|
|
Improve this Doc
View Source
GeoPoint2D(GeoPoint2D[])
Constructs a ne GeoPoint at the geometric middle of the provided points
Declaration
public GeoPoint2D(params GeoPoint2D[] p)
Parameters
|
Improve this Doc
View Source
GeoPoint2D(IJsonReadStruct)
Declaration
public GeoPoint2D(IJsonReadStruct data)
Parameters
|
Improve this Doc
View Source
GeoPoint2D(Double, Double)
Creates a new GeoPoint2D with the given components
Declaration
public GeoPoint2D(double x, double y)
Parameters
| Type |
Name |
Description |
| System.Double |
x |
x-component
|
| System.Double |
y |
y-component
|
Fields
|
Improve this Doc
View Source
CompareX
Declaration
public static IComparer CompareX
Field Value
| Type |
Description |
| System.Collections.IComparer |
|
|
Improve this Doc
View Source
Origin
Declaration
public static GeoPoint2D Origin
Field Value
|
Improve this Doc
View Source
x
Declaration
Field Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
y
Declaration
Field Value
| Type |
Description |
| System.Double |
|
Properties
|
Improve this Doc
View Source
PointF
Declaration
public PointF PointF { get; }
Property Value
| Type |
Description |
| System.Drawing.PointF |
|
Methods
|
Improve this Doc
View Source
Area(GeoPoint2D[])
Declaration
public static double Area(GeoPoint2D[] polygon)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
Center(GeoPoint2D[])
Declaration
public static GeoPoint2D Center(params GeoPoint2D[] p)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object o)
Parameters
| Type |
Name |
Description |
| System.Object |
o |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
The System.Runtime.Serialization.SerializationInfo to populate with data.
|
| System.Runtime.Serialization.StreamingContext |
context |
The destination (System.Runtime.Serialization.StreamingContext) for this serialization.
|
|
Improve this Doc
View Source
IsLeftOf(GeoPoint2D, GeoPoint2D)
Returns true, if this point is left of the given line.
Declaration
public bool IsLeftOf(GeoPoint2D from, GeoPoint2D to)
Parameters
Returns
| Type |
Description |
| System.Boolean |
true if left
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.ValueType.ToString()
|
Improve this Doc
View Source
ToVector()
Returns a 2d vector that points to this point from the origin
Declaration
public GeoVector2D ToVector()
Returns
Operators
|
Improve this Doc
View Source
Addition(GeoPoint2D, GeoVector2D)
Returns the 2D point which is the offset of v from p.
Declaration
public static GeoPoint2D operator +(GeoPoint2D p, GeoVector2D v)
Parameters
Returns
|
Improve this Doc
View Source
BitwiseAnd(GeoPoint2D, GeoPoint2D)
Square distance. Not a very nice operator symbol, but cannot overload ||, which I would prefer
Declaration
public static double operator &(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
BitwiseOr(GeoPoint2D, GeoPoint2D)
Returns the distance of the two points
Declaration
public static double operator |(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Returns
| Type |
Description |
| System.Double |
the distance
|
|
Improve this Doc
View Source
Division(GeoPoint2D, GeoPoint2D)
Declaration
public static GeoPoint2D operator /(GeoPoint2D a, GeoPoint2D b)
Parameters
Returns
|
Improve this Doc
View Source
Equality(GeoPoint2D, GeoPoint2D)
Declaration
public static bool operator ==(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Implicit(GeoPoint2D to Double[])
Declaration
public static implicit operator double[](GeoPoint2D p)
Parameters
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
Inequality(GeoPoint2D, GeoPoint2D)
Declaration
public static bool operator !=(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Subtraction(GeoPoint2D, GeoPoint2D)
Declaration
public static GeoVector2D operator -(GeoPoint2D a, GeoPoint2D b)
Parameters
Returns
|
Improve this Doc
View Source
Subtraction(GeoPoint2D, GeoVector2D)
Declaration
public static GeoPoint2D operator -(GeoPoint2D p, GeoVector2D v)
Parameters
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
|
Improve this Doc
View Source
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
Implements
System.Runtime.Serialization.ISerializable