Point2
-
class
Point2()
Constructors
Methods
Constructors
-
Point2.constructor(x, y) Arguments: - x (
number()) – value to set for x - y (
number()) – value to set for y
Creates a new point
Return type: Point2 - x (
Methods
static add
assign
equals
length
-
Point2.length() Returns the length of this point
Returns: the point length Return type: number
static scale
set
-
Point2.set(x, y) Arguments: - x (
number()) – value to set for x - y (
number()) – value to set for y
Sets the values of this point
Returns: the point object Return type: this - x (
squaredLength
-
Point2.squaredLength() Returns the squared length of this vector.
Returns: Vector squared length. Return type: number
static subtract
toJson
-
Point2.toJson() Creates an object ready for JSON serialization.
Returns: The prepared object. Return type: IPoint2