List of usage examples for javafx.geometry Point2D distance
public double distance(Point2D point)
From source file:de.pixida.logtest.designer.automaton.LineIntersector.java
static List<Intersection> calculateIntersections(final Point2D point, final Point2D vec, final List<Line> lines) { Validate.notNull(point);/*from w ww . ja v a 2 s . c o m*/ Validate.notNull(vec); Validate.notNull(lines); final List<Intersection> results = new ArrayList<>(); for (final Line line : lines) { final Point2D intersection = calculateIntersection(point, vec, line); if (intersection == null) { continue; } if (!checkIfPointIsOnTheLine(intersection, line)) { continue; } results.add(new Intersection(intersection, line, point.distance(intersection))); } Collections.sort(results, (r0, r1) -> Double.compare(r0.getDistance(), r1.getDistance())); return results; }