public class Point extends Shape
| Modifier and Type | Field and Description |
|---|---|
double |
X |
double |
Y |
DEFAULT_COLOR| Constructor and Description |
|---|
Point(double xx,
double yy)
Creates a point with the given coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Point point)
Determines if this point contains the given point.
|
static double |
distance_squared(double x1,
double y1,
double x2,
double y2)
Returns the squared distance between points with the given points.
|
static double |
distance_squared(Point p1,
Point p2)
Returns the squared distance between the given points.
|
static double |
distance(double x1,
double y1,
double x2,
double y2)
Returns the distance between points with the given coordinates.
|
static double |
distance(Point p1,
Point p2)
Returns the distance between the given points.
|
void |
draw(android.graphics.Canvas canvas)
Draws this point on the given canvas.
|
Point |
getCenter()
Returns center of this point.
|
double |
getX()
Returns the x-coordinate of this point.
|
double |
getY()
Returns the y-coordinate of this point.
|
void |
move(double dx,
double dy)
Moves this point by the given displacement.
|
public Point(double xx,
double yy)
xx - the point x-coordinateyy - the point y-coordinatepublic boolean contains(Point point)
public static double distance_squared(double x1,
double y1,
double x2,
double y2)
x1 - the x-coordinate of the first pointy1 - the y-coordinate of the first pointx2 - the x-coordinate of the second pointy2 - the y-coordinate of the second pointpublic static double distance_squared(Point p1, Point p2)
p1 - the first pointp2 - the second pointpublic static double distance(double x1,
double y1,
double x2,
double y2)
x1 - the x-coordinate of the first pointy1 - the y-coordinate of the first pointx2 - the x-coordinate of the second pointy2 - the y-coordinate of the second pointpublic static double distance(Point p1, Point p2)
p1 - the first pointp2 - the second pointpublic void draw(android.graphics.Canvas canvas)
public Point getCenter()
public double getX()
public double getY()