@Override public boolean equals(final Object other) { if ((other == null) || (false == (other instanceof Point2DArray))) { return false; } if (this == other) { return true; } final Point2DArray that = ((Point2DArray) other); final int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (false == get(i).equals(that.get(i))) { return false; } } return true; }
@Override public boolean equals(final Object other) { if ((other == null) || (false == (other instanceof Point2DArray))) { return false; } if (this == other) { return true; } final Point2DArray that = ((Point2DArray) other); final int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (false == get(i).equals(that.get(i))) { return false; } } return true; }
@Override public boolean equals(Object other) { if ((other == null) || (false == (other instanceof Point2DArray))) { return false; } if (this == other) { return true; } Point2DArray that = ((Point2DArray) other); final int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (false == get(i).equals(that.get(i))) { return false; } } return true; }
public static boolean isPointAnIntersectGiveArcBetweenTwoLines(final Point2D l1a, final Point2D l1b, final Point2D p, final Point2D l2a, final double r) { final Point2D dv = l1b.sub(l1a); final Point2D dx = dv.unit(); final Point2D dy = dx.perpendicular(); final Point2D arcCenter = l1b.add(dy.mul(r)); final double angle = getAngleBetweenTwoLines(l1b, arcCenter, l2a); final double l = getLengthFromASA(angle, r, RADIANS_90); final double l4 = Math.sqrt((l * l) - (r * r)); final Point2D intersection = dx.mul(l4); final boolean interseects = intersection.equals(p); return interseects; }
@Override public boolean equals(final Object other) { if ((other == null) || (false == (other instanceof Point2DArray))) { return false; } if (this == other) { return true; } final Point2DArray that = ((Point2DArray) other); final int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if (false == get(i).equals(that.get(i))) { return false; } } return true; }
public static boolean isPointAnIntersectGiveArcBetweenTwoLines(final Point2D l1a, final Point2D l1b, final Point2D p, final Point2D l2a, final double r) { final Point2D dv = l1b.sub(l1a); final Point2D dx = dv.unit(); final Point2D dy = dx.perpendicular(); final Point2D arcCenter = l1b.add(dy.mul(r)); final double angle = getAngleBetweenTwoLines(l1b, arcCenter, l2a); final double l = getLengthFromASA(angle, r, RADIANS_90); final double l4 = Math.sqrt((l * l) - (r * r)); final Point2D intersection = dx.mul(l4); final boolean interseects = intersection.equals(p); return interseects; }
public static boolean isPointAnIntersectGiveArcBetweenTwoLines(final Point2D l1a, final Point2D l1b, final Point2D p, final Point2D l2a, final double r) { final Point2D dv = l1b.sub(l1a); final Point2D dx = dv.unit(); final Point2D dy = dx.perpendicular(); final Point2D arcCenter = l1b.add(dy.mul(r)); final double angle = getAngleBetweenTwoLines(l1b, arcCenter, l2a); final double l = getLengthFromASA(angle, r, RADIANS_90); final double l4 = Math.sqrt((l * l) - (r * r)); final Point2D intersection = dx.mul(l4); final boolean interseects = intersection.equals(p); return interseects; }
public static BoundingBox getBoundingBoxOfArcTo(final Point2D p0, final Point2D p1, final Point2D p2, final double r) { final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r); final BoundingBox box = getBoundingBoxOfArc(arcPoints.get(0), arcPoints.get(1), arcPoints.get(2), r); if (!arcPoints.get(0).equals(p0)) { box.add(p0);//p0 is always the start point of the path, but not necessary of the arc - depending on the radius } return box; }
@Override public boolean adjust(final Point2D dxy) { boolean adjusted = false; if (connectionControl.onMove(dxy.getX(), dxy.getY())) { // Check if need for drag adjustments. final Point2D adjustPoint = connectionControl.getAdjust(); if (!adjustPoint.equals(new Point2D(0, 0))) { dxy.set(adjustPoint); adjusted = true; } } return adjusted; }
public static BoundingBox getBoundingBoxOfArcTo(final Point2D p0, final Point2D p1, final Point2D p2, final double r) { final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r); final BoundingBox box = getBoundingBoxOfArc(arcPoints.get(0), arcPoints.get(1), arcPoints.get(2), r); if (!arcPoints.get(0).equals(p0)) { box.add(p0);//p0 is always the start point of the path, but not necessary of the arc - depending on the radius } return box; }
public static BoundingBox getBoundingBoxOfArcTo(final Point2D p0, final Point2D p1, final Point2D p2, final double r) { final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r); final BoundingBox box = getBoundingBoxOfArc(arcPoints.get(0), arcPoints.get(1), arcPoints.get(2), r); if (!arcPoints.get(0).equals(p0)) { box.add(p0);//p0 is always the start point of the path, but not necessary of the arc - depending on the radius } return box; }
@Override public boolean adjust(final Point2D dxy) { boolean adjusted = false; if (connectionControl.onMove(dxy.getX(), dxy.getY())) { // Check if need for drag adjustments. final Point2D adjustPoint = connectionControl.getAdjust(); if (!adjustPoint.equals(new Point2D(0, 0))) { dxy.set(adjustPoint); adjusted = true; } } return adjusted; }
@Override public boolean adjust(final Point2D dxy) { boolean adjusted = false; if (connectionControl.onMove(dxy.getX(), dxy.getY())) { // Check if need for drag adjustments. final Point2D adjustPoint = connectionControl.getAdjust(); if (!adjustPoint.equals(new Point2D(0, 0))) { dxy.set(adjustPoint); adjusted = true; } } return adjusted; }
if (!absLocation.equals(newAbsLocation))
if (!absLocation.equals(newAbsLocation))
if (!current.equals(selectedPoint2D))
if (!current.equals(selectedPoint2D))
if (c.equals(p))
if (c.equals(p))
if (c.equals(p))