Table of Contents

Class HCoordinate

Namespace
NetTopologySuite.Algorithm
Assembly
NetTopologySuite.dll

Represents a homogeneous coordinate in a 2-D coordinate space. In NTS HCoordinates are used as a clean way of computing intersections between line segments.

public class HCoordinate
Inheritance
HCoordinate
Inherited Members

Constructors

HCoordinate()

public HCoordinate()

HCoordinate(HCoordinate, HCoordinate)

public HCoordinate(HCoordinate p1, HCoordinate p2)

Parameters

p1 HCoordinate
p2 HCoordinate

HCoordinate(Coordinate)

public HCoordinate(Coordinate p)

Parameters

p Coordinate

HCoordinate(Coordinate, Coordinate)

Constructs a homogeneous coordinate which is the intersection of the lines Coordinates. define by the homogeneous coordinates represented by two

public HCoordinate(Coordinate p1, Coordinate p2)

Parameters

p1 Coordinate

A coordinate

p2 Coordinate

A coordinate

HCoordinate(Coordinate, Coordinate, Coordinate, Coordinate)

Creates an instance of this

public HCoordinate(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)

Parameters

p1 Coordinate
p2 Coordinate
q1 Coordinate
q2 Coordinate

HCoordinate(double, double, double)

public HCoordinate(double x, double y, double w)

Parameters

x double
y double
w double

Properties

Coordinate

public Coordinate Coordinate { get; }

Property Value

Coordinate

Methods

GetX()

public double GetX()

Returns

double

GetY()

public double GetY()

Returns

double

Intersection(Coordinate, Coordinate, Coordinate, Coordinate)

Computes the (approximate) intersection point between two line segments using homogeneous coordinates.

[Obsolete("Use Intersection.Compute(Coordinate, Coordinate, Coordinate, Coordinate)")]
public static Coordinate Intersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)

Parameters

p1 Coordinate

1st Coordinate of 1st linesegment

p2 Coordinate

2nd Coordinate of 1st linesegment

q1 Coordinate

1st Coordinate of 2nd linesegment

q2 Coordinate

2nd Coordinate of 2nd linesegment

Returns

Coordinate

Remarks

Note that this algorithm is not numerically stable; i.e. it can produce intersection points which lie outside the envelope of the line segments themselves. In order to increase the precision of the calculation input points should be normalized before passing them to this routine.

OldIntersection(Coordinate, Coordinate, Coordinate, Coordinate)

Computes the (approximate) intersection point between two line segments using homogeneous coordinates. Note that this algorithm is not numerically stable; i.e. it can produce intersection points which lie outside the envelope of the line segments themselves. In order to increase the precision of the calculation input points should be normalized before passing them to this routine.

public static Coordinate OldIntersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)

Parameters

p1 Coordinate
p2 Coordinate
q1 Coordinate
q2 Coordinate

Returns

Coordinate