List of usage examples for javafx.geometry Point2D add
public Point2D add(Point2D point)
From source file:de.pixida.logtest.designer.automaton.LineIntersector.java
static boolean checkIfPointIsOnTheLine(final Point2D point, final Line line) { final Point2D lineStart = new Point2D(line.getStartX(), line.getStartY()); final Point2D lineEnd = new Point2D(line.getEndX(), line.getEndY()); final Point2D vecEndToStart = lineEnd.subtract(lineStart); final Point2D vecStartToEnd = lineStart.subtract(lineEnd); final Point2D vecEndToStartRotated = ROATE_90_DEGREES_COUNTERCLOCKWISE.transform(vecEndToStart); final Point2D vecStartToEndRotated = ROATE_90_DEGREES_COUNTERCLOCKWISE.transform(vecStartToEnd); if (getPointSideOfLine(point, lineEnd, lineEnd.add(vecEndToStartRotated)) == PointPosition.LEFT_OF_THE_LINE) { return false; }//from ww w . j a v a2 s .c om if (getPointSideOfLine(point, lineStart, lineStart.add(vecStartToEndRotated)) == PointPosition.LEFT_OF_THE_LINE) { return false; } return true; }