@Test void nearestLinePoint() { assertEquals( new Line(new Point(-50, -50), new Point(-50, 50)) .nearestLinePoint(new Point(5, 5)), new Point(-50, 5)); }
public Point nearestLinePoint(Point p) { Line perpContainer = new Line(p, this.perpendicularSlope()); return this.intersect(perpContainer); }
Line { public Point nearestLinePoint(Point p) { Line perpContainer = new Line(p, this.perpendicularSlope()); return this.intersect(perpContainer); } }
Line { public Point nearestLinePoint(Point p) { Line perpContainer = new Line(p, this.perpendicularSlope()); return this.intersect(perpContainer); } Line(Point p1, Point p2);  Line(Point point, double slope);  Line(double slope, double yIntercept); }
Line { public Point nearestLinePoint(Point p) { Line perpContainer = new Line(p, this.perpendicularSlope()); return this.intersect(perpContainer); } Line(Point p1, Point p2);  Line(Point point, double slope);  Line(double slope, double yIntercept); double perpendicularSlope(); double evaluate(double x); Point intersect(Line l2); Point nearestLinePoint(Point p); boolean isVertical(); static Point midpoint(Point p1, Point p2); static double distance(Point p1, Point p2); @Override boolean equals(Object o); }
Line { public Point nearestLinePoint(Point p) { Line perpContainer = new Line(p, this.perpendicularSlope()); return this.intersect(perpContainer); } Line(Point p1, Point p2);  Line(Point point, double slope);  Line(double slope, double yIntercept); double perpendicularSlope(); double evaluate(double x); Point intersect(Line l2); Point nearestLinePoint(Point p); boolean isVertical(); static Point midpoint(Point p1, Point p2); static double distance(Point p1, Point p2); @Override boolean equals(Object o);  }