Class LineSegment

java.lang.Object
org.ampere.base.util.LineSegment

public class LineSegment extends Object
Line segment
Author:
morel
  • Field Details

    • x1

      public double x1
    • x2

      public double x2
    • y1

      public double y1
    • y2

      public double y2
  • Constructor Details

    • LineSegment

      public LineSegment(double x1, double x2, double y1, double y2)
      Creates a new instance of LineSegment
  • Method Details

    • include

      public boolean include(double x)
      return true if the abscissa x is inside the abscissa interval.
    • includeAbscissa

      public boolean includeAbscissa(LineSegment u)
      return true if the all the abscissa of the LineSegment 'v' are included in the abscissa interval.
    • interpolation

      public double interpolation(double x)
      compute the linear interpolation of the ordinate for abscissa, x.
    • isVertical

      public boolean isVertical()
      return true if the segment is vertical
    • isParallelTo

      public boolean isParallelTo(LineSegment v)
      retun true if the segment is parallel to 'v'.
    • bottomTruncature

      public LineSegment bottomTruncature(double x)
      return the upper truncature at abscissa, x.
    • topTruncature

      public LineSegment topTruncature(double x)
      return the lower truncature at abscissa, x.
    • integralWith

      public double integralWith(LineSegment v, int type)
      compute a integral based on two LineSegment u and v. u is this LineSegment. v is the LineSegment v. type may be one of the following: 0 : correspond to scalar product u.v. 1 : correspond to area between u and v.