Constructors
constructor
-
Parameters
-
x: number
value to set for x
-
y: number
value to set for y
Returns Point2
-
Properties
x
y
Methods
add
assign
copy
-
Creates a copy of this point
Returns Point2
Copy of this point
equals
-
Compares this point with another point
Parameters
-
pt: Point2
the point to compare with
Returns boolean
True if the values of this point equal the other. False otherwise.
-
forJson
[deprecated]
-
Returns Object
length
-
Returns the length of this point
Returns number
the point length
scale
-
Scales the point by a constant value
Parameters
-
k: number
the value to scale by
Returns Point2
the point object
-
set
-
Sets the values of this point
Parameters
-
x: number
value to set for x
-
y: number
value to set for y
Returns Point2
the point object
-
squaredLength
-
Returns the squared length of this vector.
Returns number
Vector squared length.
subtract
toJson
-
Creates an object ready for JSON serialization.
Returns Object
The prepared object.
Static add
Static distance
Static fromJson
Static fromPoint3
Static scale
Static subtract
Static zero
-
Creates a point initialized to (0,0)
Returns Point2
The new point
Creates a new point