The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
add
other
Adds the x and y values of a point to this point.
other
Point
The point to add to this one
dotProd
other
Returns the dot product between this point and another one.
other
Point
The point to form a dot product with
The dot product between the two points.
fromJSON
inputObj
Works with a reviver function to restore from a native Object to an instance of this type.
inputObj
Object
serialized object
lengthSq
Returns the squared length (or magnitude) of this point. This is faster than length().
The length squared of this point.
scaleBy
value
Multiplies the x and y values of this point by a value.
value
Number
The value to scale by.
subtract
other
Subtracts the x and y values of a point from this point.
other
Point
The point to subtract from this one
toJSON
creates a serializable form of this object so it may be saved or passed via Bellhop.
Note that it adds a special property named __classname
to tell the Reviver
how to restore a pristine Object
serializable object
truncate
maxLength
Truncate the length of the point to a maximum.
maxLength
Number
The maximum length to allow in this point.