Show / Hide Table of Contents

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
IJsonSerialize
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
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
Type Name Description
GeoPoint2D p1

first point

GeoPoint2D p2

second point

| Improve this Doc View Source

GeoPoint2D(GeoPoint2D, GeoPoint2D, Double)

Declaration
public GeoPoint2D(GeoPoint2D p1, GeoPoint2D p2, double ratio)
Parameters
Type Name Description
GeoPoint2D p1
GeoPoint2D p2
System.Double ratio
| 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
Type Name Description
GeoPoint2D[] p
| Improve this Doc View Source

GeoPoint2D(IJsonReadStruct)

Declaration
public GeoPoint2D(IJsonReadStruct data)
Parameters
Type Name Description
IJsonReadStruct data
| 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
Type Description
GeoPoint2D
| Improve this Doc View Source

x

x-component

Declaration
public double x
Field Value
Type Description
System.Double
| Improve this Doc View Source

y

y-component

Declaration
public double y
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
Type Name Description
GeoPoint2D[] polygon
Returns
Type Description
System.Double
| Improve this Doc View Source

Center(GeoPoint2D[])

Declaration
public static GeoPoint2D Center(params GeoPoint2D[] p)
Parameters
Type Name Description
GeoPoint2D[] p
Returns
Type Description
GeoPoint2D
| 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
Type Name Description
GeoPoint2D from

Startpoint of the line

GeoPoint2D to

Endpoint of the line

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
Type Description
GeoVector2D

The 2d vector

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
Type Name Description
GeoPoint2D p

Original point

GeoVector2D v

Offset

Returns
Type Description
GeoPoint2D

The offset point

| 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
Type Name Description
GeoPoint2D p1
GeoPoint2D p2
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
Type Name Description
GeoPoint2D p1

first point

GeoPoint2D p2

second point

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
Type Name Description
GeoPoint2D a
GeoPoint2D b
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

Equality(GeoPoint2D, GeoPoint2D)

Declaration
public static bool operator ==(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Type Name Description
GeoPoint2D p1
GeoPoint2D p2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Implicit(GeoPoint2D to Double[])

Declaration
public static implicit operator double[](GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p
Returns
Type Description
System.Double[]
| Improve this Doc View Source

Inequality(GeoPoint2D, GeoPoint2D)

Declaration
public static bool operator !=(GeoPoint2D p1, GeoPoint2D p2)
Parameters
Type Name Description
GeoPoint2D p1
GeoPoint2D p2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Subtraction(GeoPoint2D, GeoPoint2D)

Declaration
public static GeoVector2D operator -(GeoPoint2D a, GeoPoint2D b)
Parameters
Type Name Description
GeoPoint2D a
GeoPoint2D b
Returns
Type Description
GeoVector2D
| Improve this Doc View Source

Subtraction(GeoPoint2D, GeoVector2D)

Declaration
public static GeoPoint2D operator -(GeoPoint2D p, GeoVector2D v)
Parameters
Type Name Description
GeoPoint2D p
GeoVector2D v
Returns
Type Description
GeoPoint2D

Explicit Interface Implementations

| Improve this Doc View Source

IJsonSerialize.GetObjectData(IJsonWriteData)

Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
Type Name Description
IJsonWriteData data
| Improve this Doc View Source

IJsonSerialize.SetObjectData(IJsonReadData)

Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
Type Name Description
IJsonReadData data

Implements

System.Runtime.Serialization.ISerializable
IJsonSerialize
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX