Class LineIntersectsResult

java.lang.Object
com.mapbox.turf.models.LineIntersectsResult

public class LineIntersectsResult extends Object
if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point.
Since:
1.2.0
See Also:
  • Method Details

    • builder

      public static LineIntersectsResult.Builder builder()
      Builds a new instance of a lineIntersection. This class is mainly used internally for other turf objects to recall memory when performing calculations.
      Returns:
      LineIntersectsResult.Builder for creating a new instance
      Since:
      3.0.0
    • horizontalIntersection

      @Nullable public Double horizontalIntersection()
      If the lines intersect, use this method to get the intersecting point X value.
      Returns:
      the X value where the lines intersect
      Since:
      1.2.0
    • verticalIntersection

      @Nullable public Double verticalIntersection()
      If the lines intersect, use this method to get the intersecting point Y value.
      Returns:
      the Y value where the lines intersect
      Since:
      1.2.0
    • onLine1

      public boolean onLine1()
      Determine if the intersecting point lands on line 1 or not.
      Returns:
      true if the intersecting point is located on line 1, otherwise false
      Since:
      1.2.0
    • onLine2

      public boolean onLine2()
      Determine if the intersecting point lands on line 2 or not.
      Returns:
      true if the intersecting point is located on line 2, otherwise false
      Since:
      1.2.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toBuilder

      public LineIntersectsResult.Builder toBuilder()
      Convert current instance values into another Builder to quickly change one or more values.
      Returns:
      a new instance of LineIntersectsResult using the newly defined values
      Since:
      3.0.0