@JsType(isNative=true) public class Point extends Object
Modifier and Type | Field and Description |
---|---|
double |
x
The x coordinate.
|
double |
y
The The y coordinate.
|
Constructor and Description |
---|
Point() |
Modifier and Type | Method and Description |
---|---|
Point |
add(Point otherPoint)
Returns the result of addition of the current and the given points.
|
Point |
clone() |
Boolean |
contains(Point point)
Returns true if the both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
|
double |
distanceTo(Point otherPoint)
Returns the distance between the current and the given points.
|
Point |
divideBy(double number,
Boolean round)
Returns the result of division of the current point by the given number.
|
Boolean |
equals(Point otherPoint)
Returns true if the given point has the same coordinates.
|
Point |
floor()
Returns a copy of the current point with floored coordinates (rounded down).
|
Point |
multiplyBy(double number)
Returns the result of multiplication of the current point by the given number.
|
Point |
round()
Returns a copy of the current point with rounded coordinates.
|
Point |
subtract(Point otherPoint)
Returns the result of subtraction of the given point from the current.
|
String |
toString() |
@JsProperty public double x
@JsProperty public double y
@JsMethod public Point add(Point otherPoint)
otherPoint
- the other point@JsMethod public Point subtract(Point otherPoint)
otherPoint
- the other point@JsMethod public Point multiplyBy(double number)
number
- the number@JsMethod public Point divideBy(double number, Boolean round)
number
- the numberround
- the round@JsMethod public double distanceTo(Point otherPoint)
otherPoint
- the other point@JsMethod public Point round()
@JsMethod public Point floor()
@JsMethod public Boolean contains(Point point)
point
- the point@JsMethod public Boolean equals(Point otherPoint)
otherPoint
- the other pointCopyright © 2018 G-Widgets. All rights reserved.