Point Class
Represents a point on a 2 dimensional x / y coordinate system.
Example
var point = new createjs.Point(0, 100);
Constructor
Item Index
Methods
clone
()
Point
Returns a clone of the Point instance.
Returns:
a clone of the Point instance.
copy
-
point
Copies all properties from the specified point to this point.
Parameters:
-
point
PointThe point to copy properties from.
Returns:
This point. Useful for chaining method calls.
interpolate
-
pt1
-
pt2
-
f
-
[pt]
Determine a point between two specified points.
The parameter f
determines where the new interpolated point is located relative to the two end points specified
by parameters pt1
and pt2
:
- The closer the value of the parameter
f
is to 1.0, the closer the interpolated point is to the first point (parameterpt1
). - The closer the value of the parameter
f
is to 0, the closer the interpolated point is to the second point (parameterpt2
).
Parameters:
-
pt1
Point | ObjectThe first point as a Point or generic object.
-
pt2
Point | ObjectThe second point as a Point or generic object.
-
f
NumberThe level of interpolation between the two points. Indicates where the new point will be, along the line between
pt1
andpt2
. Iff=1
,pt1
is returned; iff=0
,pt2
is returned. -
[pt]
Point | Object optionalAn object to copy the result into. If omitted, a new Point will be returned.
Returns:
A new interpolated Point, or the pt
passed in the 4th parameter with the interpolated values.
offset
-
dx
-
dy
Offsets the Point object by the specified amount.
- The value of
dx
is added to the original value ofx
to create the newx
value - The value of
dy
is added to the original value ofy
to create the newy
value
Parameters:
Returns:
This instance. Useful for chaining method calls.
polar
-
len
-
angle
-
[pt]
Converts a pair of polar coordinates to a Cartesian point coordinate.
Parameters:
Returns:
The new, interpolated point.