android.graphics.Point
Point holds two integer coordinates
Summary
Fields
| public |
|
|
int |
x |
|
| public |
|
|
int |
y |
|
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
Public Constructors
public
Point(int x, int y)
Set the point's X and Y coordinates
Public Methods
public
final
void
add(Point v)
Add v's coordinates to the point's
public
static
float
crossProduct(Point a, Point b)
Returns the cross product of a and b, treating them as 2D vectors
public
static
Point
difference(Point a, Point b)
Returns a new point whose coordinates are the difference between a's and b's (a - b)
public
static
float
distance(Point a, Point b)
Returns the euclidian distance between a and b
public
static
float
dotProduct(Point a, Point b)
Returns the dot product of a and b, treating them as 2D vectors
public
final
boolean
equals(int _x, int _y)
Returns true if the point's coordinates equal (x,y)
public
static
float
length(float x, float y)
Returns the euclidian distance from (0,0) to (x,y)
public
final
void
negate()
Negate the point's coordinates
public
final
void
rotateCCW()
Rotate the point counter-clockwise by 90 degrees, writing the answer back into the point.
public
final
void
rotateCW()
Rotate the point clockwise by 90 degrees, writing the answer back into the point.
public
void
set(int x, int y)
Set the point's X and Y coordinates
public
final
void
subtract(Point v)
Subtract v's coordinates from the point's
Returns a new point whose coordinates are the sum of a's and b's (a + b)