Small tidying.
This commit is contained in:
@@ -20,12 +20,14 @@ public abstract class AbstractCircle implements ICircle
|
|||||||
|
|
||||||
@Override // from ICircle
|
@Override // from ICircle
|
||||||
public boolean contains (IPoint p) {
|
public boolean contains (IPoint p) {
|
||||||
return Points.distanceSq(x(), y(), p.x(), p.y()) < radius() * radius();
|
float r = radius();
|
||||||
|
return Points.distanceSq(x(), y(), p.x(), p.y()) < r * r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from ICircle
|
@Override // from ICircle
|
||||||
public boolean contains (float x, float y) {
|
public boolean contains (float x, float y) {
|
||||||
return Points.distanceSq(x(), y(), x, y) < radius() * radius();
|
float r = radius();
|
||||||
|
return Points.distanceSq(x(), y(), x, y) < r * r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from ICircle
|
@Override // from ICircle
|
||||||
|
|||||||
@@ -28,13 +28,11 @@ public interface ICircle
|
|||||||
boolean contains (float x, float y);
|
boolean contains (float x, float y);
|
||||||
|
|
||||||
/** Translates the circle by the specified offset.
|
/** Translates the circle by the specified offset.
|
||||||
* @return a new Circle containing the result.
|
* @return a new Circle containing the result. */
|
||||||
*/
|
|
||||||
Circle offset (float x, float y);
|
Circle offset (float x, float y);
|
||||||
|
|
||||||
/** Translates the circle by the specified offset and stores the result in the supplied object.
|
/** Translates the circle by the specified offset and stores the result in the supplied object.
|
||||||
* @return a reference to the result, for chaining.
|
* @return a reference to the result, for chaining. */
|
||||||
*/
|
|
||||||
Circle offset (float x, float y, Circle result);
|
Circle offset (float x, float y, Circle result);
|
||||||
|
|
||||||
/** Returns a mutable copy of this circle. */
|
/** Returns a mutable copy of this circle. */
|
||||||
|
|||||||
Reference in New Issue
Block a user