java.lang.Object
net.buildtheearth.terraminusminus.dataset.vector.geometry.Segment
All Implemented Interfaces:
Bounds2d, Interval

public final class Segment extends Object implements Bounds2d, Interval
A simple representation of a line segment as a pair of two sets of coordinates.
  • Field Details

    • x0

      protected final double x0
    • z0

      protected final double z0
    • x1

      protected final double x1
    • z1

      protected final double z1
  • Constructor Details

    • Segment

      public Segment(double x0, double z0, double x1, double z1)
  • Method Details

    • minX

      public double minX()
      Specified by:
      minX in interface Bounds2d
      Returns:
      the minimum X coordinate
    • maxX

      public double maxX()
      Specified by:
      maxX in interface Bounds2d
      Returns:
      the maximum X coordinate
    • minZ

      public double minZ()
      Specified by:
      minZ in interface Bounds2d
      Returns:
      the minimum Z coordinate
    • maxZ

      public double maxZ()
      Specified by:
      maxZ in interface Bounds2d
      Returns:
      the maximum Z coordinate
    • min

      public double min()
      Specified by:
      min in interface Interval
      Returns:
      the minimum coordinate
    • max

      public double max()
      Specified by:
      max in interface Interval
      Returns:
      the maximum coordinate
    • x0

      public double x0()
    • z0

      public double z0()
    • x1

      public double x1()
    • z1

      public double z1()
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object