/** * Returns the Euclidean distance between the specified two points. */ public static float distance (float x1, float y1, float x2, float y2) { return FloatMath.sqrt(distanceSq(x1, y1, x2, y2)); }
/** * Returns the Euclidean distance between the specified two points. */ public static float distance (float x1, float y1, float x2, float y2) { return FloatMath.sqrt(distanceSq(x1, y1, x2, y2)); }
@Override // from IPoint public float distanceSq (float px, float py) { return Points.distanceSq(x(), y(), px, py); }
@Override // from IPoint public float distanceSq (float px, float py) { return Points.distanceSq(x(), y(), px, py); }
@Override // from ICircle public boolean contains (float x, float y) { float r = radius(); return Points.distanceSq(x(), y(), x, y) < r * r; }
/** * Returns the squared Euclidean distance between the given point and the nearest point inside * the bounds of the given rectangle. If the supplied point is inside the rectangle, the * distance will be zero. */ public static float pointRectDistanceSq (IRectangle r, IPoint p) { Point p2 = closestInteriorPoint(r, p); return Points.distanceSq(p.x(), p.y(), p2.x, p2.y); }
@Override // from ICircle public boolean contains (float x, float y) { float r = radius(); return Points.distanceSq(x(), y(), x, y) < r * r; }
/** * Returns the squared Euclidean distance between the given point and the nearest point inside * the bounds of the given rectangle. If the supplied point is inside the rectangle, the * distance will be zero. */ public static float pointRectDistanceSq (IRectangle r, IPoint p) { Point p2 = closestInteriorPoint(r, p); return Points.distanceSq(p.x(), p.y(), p2.x, p2.y); }
@Override // from IPoint public float distanceSq (XY p) { return Points.distanceSq(x(), y(), p.x(), p.y()); }
@Override // from IPoint public float distanceSq (XY p) { return Points.distanceSq(x(), y(), p.x(), p.y()); }
@Override // from ICircle public boolean contains (XY p) { float r = radius(); return Points.distanceSq(x(), y(), p.x(), p.y()) < r * r; }
@Override // from ICircle public boolean contains (XY p) { float r = radius(); return Points.distanceSq(x(), y(), p.x(), p.y()) < r * r; }
@Override // from ICircle public boolean intersects (ICircle c) { float maxDist = radius() + c.radius(); return Points.distanceSq(x(), y(), c.x(), c.y()) < (maxDist * maxDist); }
@Override // from ICircle public boolean intersects (ICircle c) { float maxDist = radius() + c.radius(); return Points.distanceSq(x(), y(), c.x(), c.y()) < (maxDist * maxDist); }