class LineSegment extends Comparable[LineSegment] with Serializable

Annotations
@SerialVersionUID()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LineSegment
  2. Serializable
  3. Comparable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new LineSegment()
  2. new LineSegment(ls: LineSegment)
  3. new LineSegment(x0: Double, y0: Double, x1: Double, y1: Double)
  4. new LineSegment(p0: Coordinate, p1: Coordinate)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def angle: Double

    Computes the angle that the vector defined by this segment makes with the X-axis.

    Computes the angle that the vector defined by this segment makes with the X-axis. The angle will be in the range [ -PI, PI ] radians.

    return the angle this segment makes with the X-axis (in radians)

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def closestPoint(p: Coordinate): Coordinate

    Computes the closest point on this line segment to another point.

    Computes the closest point on this line segment to another point.

    p

    the point to find the closest point to return a Coordinate which is the closest point on the line segment to the point p

  8. def closestPoints(line: LineSegment): Array[Coordinate]

    Computes the closest points on two line segments.

    Computes the closest points on two line segments.

    line

    the segment to find the closest point to return a pair of Coordinates which are the closest points on the line segments

  9. def compareTo(other: LineSegment): Int

    Compares this object with the specified object for order.

    Compares this object with the specified object for order. Uses the standard lexicographic ordering for the points in the LineSegment.

    Definition Classes
    LineSegment → Comparable
  10. def distance(p: Coordinate): Double

    Computes the distance between this line segment and a given point.

    Computes the distance between this line segment and a given point.

    return the distance from this segment to the given point

  11. def distance(ls: LineSegment): Double

    Computes the distance between this line segment and another segment.

    Computes the distance between this line segment and another segment.

    return the distance to the other segment

  12. def distancePerpendicular(p: Coordinate): Double

    Computes the perpendicular distance between the (infinite) line defined by this line segment and a point.

    Computes the perpendicular distance between the (infinite) line defined by this line segment and a point.

    return the perpendicular distance between the defined line and the given point

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(o: Any): Boolean

    Returns true if other has the same values for its points.

    Returns true if other has the same values for its points.

    o

    a LineSegment with which to do the comparison. return true if other is a LineSegment with the same values for the x and y ordinates.

    Definition Classes
    LineSegment → AnyRef → Any
  15. def equalsTopo(other: LineSegment): Boolean

    Returns true if other is topologically equal to this LineSegment (e.g.

    Returns true if other is topologically equal to this LineSegment (e.g. irrespective of orientation).

    other

    a LineSegment with which to do the comparison. return true if other is a LineSegment with the same values for the x and y ordinates.

  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getCoordinate(i: Int): Coordinate
  19. def getLength: Double

    Computes the length of the line segment.

    Computes the length of the line segment.

    return the length of the line segment

  20. def hashCode(): Int

    Gets a hashcode for this object.

    Gets a hashcode for this object.

    return a hashcode for this object

    Definition Classes
    LineSegment → AnyRef → Any
  21. def intersection(line: LineSegment): Coordinate

    Computes an intersection point between two line segments, if there is one.

    Computes an intersection point between two line segments, if there is one. There may be 0, 1 or many intersection points between two segments. If there are 0, null is returned. If there is 1 or more, exactly one of them is returned (chosen at the discretion of the algorithm). If more information is required about the details of the intersection, the {link RobustLineIntersector} class should be used.

    line

    a line segment return an intersection point, or null if there is none

    See also

    RobustLineIntersector

  22. def isHorizontal: Boolean

    Tests whether the segment is horizontal.

    Tests whether the segment is horizontal.

    return true if the segment is horizontal

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def isVertical: Boolean

    Tests whether the segment is vertical.

    Tests whether the segment is vertical.

    return true if the segment is vertical

  25. def lineIntersection(line: LineSegment): Coordinate

    Computes the intersection point of the lines of infinite extent defined by two line segments (if there is one).

    Computes the intersection point of the lines of infinite extent defined by two line segments (if there is one). There may be 0, 1 or an infinite number of intersection points between two lines. If there is a unique intersection point, it is returned. Otherwise, null is returned. If more information is required about the details of the intersection, the {link RobustLineIntersector} class should be used.

    line

    a line segment defining an straight line with infinite extent return an intersection point, or null if there is no point of intersection or an infinite number of intersection points

    See also

    RobustLineIntersector

  26. def maxX: Double

    Gets the maximum X ordinate.

    Gets the maximum X ordinate.

    return the maximum X ordinate

  27. def maxY: Double

    Gets the maximum Y ordinate.

    Gets the maximum Y ordinate.

    return the maximum Y ordinate

  28. def midPoint: Coordinate

    Computes the midpoint of the segment

    Computes the midpoint of the segment

    return the midpoint of the segment

  29. def minX: Double

    Gets the minimum X ordinate.

    Gets the minimum X ordinate.

    return the minimum X ordinate

  30. def minY: Double

    Gets the minimum Y ordinate.

    Gets the minimum Y ordinate.

    return the minimum Y ordinate

  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def normalize(): Unit

    Puts the line segment into a normalized form.

    Puts the line segment into a normalized form. This is useful for using line segments in maps and indexes when topological equality rather than exact equality is desired. A segment in normalized form has the first point smaller than the second (according to the standard ordering on {link Coordinate}).

  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def orientationIndex(p: Coordinate): Int

    Determines the orientation index of a {link Coordinate} relative to this segment.

    Determines the orientation index of a {link Coordinate} relative to this segment. The orientation index is as defined in {link Orientation#computeOrientation}.

    p

    the coordinate to compare return 1 (LEFT) if p is to the left of this segment return -1 (RIGHT) if p is to the right of this segment return 0 (COLLINEAR) if p is collinear with this segment

    See also

    Orientation#computeOrientation(Coordinate, Coordinate, Coordinate)

  36. def orientationIndex(seg: LineSegment): Int

    Determines the orientation of a LineSegment relative to this segment.

    Determines the orientation of a LineSegment relative to this segment. The concept of orientation is specified as follows: Given two line segments A and L,

    • A is to the left of a segment L if A lies wholly in the closed half-plane lying to the left of L
    • A is to the right of a segment L if A lies wholly in the closed half-plane lying to the right of L
    • otherwise, A has indeterminate orientation relative to L. This happens if A is collinear with L or if A crosses the line determined by L.
    seg

    the LineSegment to compare return 1 if seg is to the left of this segment return -1 if seg is to the right of this segment return 0 if seg is collinear to or crosses this segment

  37. var p0: Coordinate
  38. var p1: Coordinate
  39. def pointAlong(segmentLengthFraction: Double): Coordinate

    Computes the {link Coordinate} that lies a given fraction along the line defined by this segment.

    Computes the {link Coordinate} that lies a given fraction along the line defined by this segment. A fraction of 0.0 returns the start point of the segment; a fraction of 1.0 returns the end point of the segment. If the fraction is < 0.0 or > 1.0 the point returned will lie before the start or beyond the end of the segment.

    segmentLengthFraction

    the fraction of the segment length along the line return the point at that distance

  40. def pointAlongOffset(segmentLengthFraction: Double, offsetDistance: Double): Coordinate

    Computes the {link Coordinate} that lies a given fraction along the line defined by this segment and offset from the segment by a given distance.

    Computes the {link Coordinate} that lies a given fraction along the line defined by this segment and offset from the segment by a given distance. A fraction of 0.0 offsets from the start point of the segment; a fraction of 1.0 offsets from the end point of the segment. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative.

    segmentLengthFraction

    the fraction of the segment length along the line

    offsetDistance

    the distance the point is offset from the segment (positive is to the left, negative is to the right) return the point at that distance and offset throws IllegalStateException if the segment has zero length

  41. def project(seg: LineSegment): LineSegment

    Project a line segment onto this line segment and return the resulting line segment.

    Project a line segment onto this line segment and return the resulting line segment. The returned line segment will be a subset of the target line line segment. This subset may be null, if the segments are oriented in such a way that there is no projection.

    Note that the returned line may have zero length (i.e. the same endpoints). This can happen for instance if the lines are perpendicular to one another.

    seg

    the line segment to project return the projected line segment, or null if there is no overlap

  42. def project(p: Coordinate): Coordinate

    Compute the projection of a point onto the line determined by this line segment.

    Compute the projection of a point onto the line determined by this line segment.

    Note that the projected point may lie outside the line segment. If this is the case, the projection factor will lie outside the range [0.0, 1.0].

  43. def projectionFactor(p: Coordinate): Double

    Computes the Projection Factor for the projection of the point p onto this LineSegment.

    Computes the Projection Factor for the projection of the point p onto this LineSegment. The Projection Factor is the constant r by which the vector for this segment must be multiplied to equal the vector for the projection of p on the line defined by this segment.

    The projection factor will lie in the range (-inf, +inf), or be NaN if the line segment has zero length..

    p

    the point to compute the factor for return the projection factor for the point

  44. def reflect(p: Coordinate): Coordinate

    Computes the reflection of a point in the line defined by this line segment.

    Computes the reflection of a point in the line defined by this line segment.

    p

    the point to reflect return the reflected point

  45. def reverse(): Unit

    Reverses the direction of the line segment.

  46. def segmentFraction(inputPt: Coordinate): Double

    Computes the fraction of distance (in [0.0, 1.0]) that the projection of a point occurs along this line segment.

    Computes the fraction of distance (in [0.0, 1.0]) that the projection of a point occurs along this line segment. If the point is beyond either ends of the line segment, the closest fractional value (0.0 or 1.0) is returned.

    Essentially, this is the {link #projectionFactor} clamped to the range [0.0, 1.0]. If the segment has zero length, 1.0 is returned.

    inputPt

    the point return the fraction along the line segment the projection of the point occurs

  47. def setCoordinates(p0: Coordinate, p1: Coordinate): Unit
  48. def setCoordinates(ls: LineSegment): Unit
  49. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  50. def toGeometry(geomFactory: GeometryFactory): LineString

    Creates a LineString with the same coordinates as this segment

    Creates a LineString with the same coordinates as this segment

    geomFactory

    the geometry factory to use return a LineString with the same geometry as this segment

  51. def toString(): String
    Definition Classes
    LineSegment → AnyRef → Any
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Comparable[LineSegment]

Inherited from AnyRef

Inherited from Any

Ungrouped