Methods Summary |
---|
public boolean | IsInUnitRange()
return x >= 0.0f && x <= 1.0f &&
y >= 0.0f && y <= 1.0f;
|
public float | distanceTo(android.filterfw.geometry.Point p)
return p.minus(this).length();
|
public float | length()
return (float)Math.sqrt(x*x + y*y);
|
public android.filterfw.geometry.Point | minus(float x, float y)
return new Point(this.x - x, this.y - y);
|
public android.filterfw.geometry.Point | minus(android.filterfw.geometry.Point point)
return this.minus(point.x, point.y);
|
public android.filterfw.geometry.Point | mult(float x, float y)
return new Point(this.x * x, this.y * y);
|
public android.filterfw.geometry.Point | normalize()
return this.scaledTo(1.0f);
|
public android.filterfw.geometry.Point | plus(float x, float y)
return new Point(this.x + x, this.y + y);
|
public android.filterfw.geometry.Point | plus(android.filterfw.geometry.Point point)
return this.plus(point.x, point.y);
|
public android.filterfw.geometry.Point | rotated(float radians)
// TODO(renn): Optimize: Keep cache of cos/sin values
return new Point((float)(Math.cos(radians) * x - Math.sin(radians) * y),
(float)(Math.sin(radians) * x + Math.cos(radians) * y));
|
public android.filterfw.geometry.Point | rotated90(int count)
float nx = this.x;
float ny = this.y;
for (int i = 0; i < count; ++i) {
float ox = nx;
nx = ny;
ny = -ox;
}
return new Point(nx, ny);
|
public android.filterfw.geometry.Point | rotatedAround(android.filterfw.geometry.Point center, float radians)
return this.minus(center).rotated(radians).plus(center);
|
public android.filterfw.geometry.Point | scaledTo(float length)
return this.times(length / this.length());
|
public void | set(float x, float y)
this.x = x;
this.y = y;
|
public android.filterfw.geometry.Point | times(float s)
return new Point(this.x * s, this.y * s);
|
public java.lang.String | toString()
return "(" + x + ", " + y + ")";
|