Class Line

java.lang.Object
org.jhotdraw8.geom.biarc.Line

public class Line extends Object
Defines a line in point-slope form: y - y1 = m * (x - x1).

Vertical line: m = NaN

Horizontal line: m = 0

  • Field Details

    • m

      public final double m
      Slope.
    • p

      public final Point2D.Double p
      Point.
  • Constructor Details

    • Line

      public Line(Point2D.Double p1, Point2D.Double p2)
      Define a line by two points.
      Parameters:
      p1 - first point
      p2 - second point
    • Line

      public Line(Point2D.Double p, double m)
      Define a line by a point and slope.
      Parameters:
      p - point
      m - slope
  • Method Details

    • Intersection

      public Point2D.Double Intersection(Line l)
      Calculate the intersection point of this line and another one.
      Parameters:
      l - another line
      Returns:
      the intersection point
    • createPerpendicularAt

      public static Line createPerpendicularAt(Point2D.Double P, Point2D.Double P1)
      Creates a a line which is perpendicular to the line defined by P and P1 and goes through P
      Parameters:
      P -
      P1 -
      Returns: