@Override public String toString () { return Points.pointToString(x(), y()); } }
@Override // from IPoint public float distance (float px, float py) { return Points.distance(x(), y(), px, py); }
/** * 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)); }
/** Transforms a point as specified, storing the result in the point provided. * @return a reference to the result point, for chaining. */ public static Point transform (float x, float y, float sx, float sy, float rotation, float tx, float ty, Point result) { return transform(x, y, sx, sy, FloatMath.sin(rotation), FloatMath.cos(rotation), tx, ty, result); }
/** * Returns true if the supplied points' x and y components are equal to one another within * {@link MathUtil#EPSILON}. */ public static boolean epsilonEquals (IPoint p1, IPoint p2) { return epsilonEquals(p1, p2, MathUtil.EPSILON); }
/** Transforms a point as specified, storing the result in the point provided. * @return a reference to the result point, for chaining. */ public static Point transform (float x, float y, float sx, float sy, float rotation, float tx, float ty, Point result) { return transform(x, y, sx, sy, FloatMath.sin(rotation), FloatMath.cos(rotation), tx, ty, result); }
/** * Returns true if the supplied points' x and y components are equal to one another within * {@link MathUtil#EPSILON}. */ public static boolean epsilonEquals (IPoint p1, IPoint p2) { return epsilonEquals(p1, p2, MathUtil.EPSILON); }
@Override public String toString () { return Points.pointToString(x(), y()); } }
/** * 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 distance (float px, float py) { return Points.distance(x(), y(), px, py); }
@Override public String toString () { return "Tile[" + width() + "x" + height() + "/" + Points.pointToString(sx(), sy()) + "/" + Points.pointToString(tx(), ty()) + "] <- " + texture(); } }
@Override // from IPoint public float distanceSq (float px, float py) { return Points.distanceSq(x(), y(), px, py); }
@Override // from IPoint public float distance (XY p) { return Points.distance(x(), y(), p.x(), p.y()); }
@Override public String toString () { return "Tile[" + width() + "x" + height() + "/" + Points.pointToString(sx(), sy()) + "/" + Points.pointToString(tx(), ty()) + "] <- " + texture(); } }
@Override // from IPoint public float distanceSq (float px, float py) { return Points.distanceSq(x(), y(), px, py); }
@Override // from IPoint public float distance (XY p) { return Points.distance(x(), y(), p.x(), p.y()); }
@Override // from Object public String toString () { return Dimensions.dimenToString(width(), height()) + Points.pointToString(x(), y()); }
@Override // from ICircle public boolean contains (float x, float y) { float r = radius(); return Points.distanceSq(x(), y(), x, y) < r * r; }
@Override // from Object public String toString () { return Dimensions.dimenToString(width(), height()) + Points.pointToString(x(), y()); }
/** * 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); }