Point
Adaptation of work of Kevin Lindsey(kevin@kevlindev.com)
Implements
Constructors
new Point()
new Point():
Point
Returns
Defined in
new Point()
new Point(
x
,y
):Point
Parameters
• x: number
• y: number
Returns
Defined in
new Point()
new Point(
point
?):Point
Parameters
• point?: XY
Returns
Defined in
Properties
x
x:
number
Implementation of
Defined in
y
y:
number
Implementation of
Defined in
Methods
add()
add(
that
):Point
Adds another point to this one and returns another one
Parameters
• that: XY
Returns
new Point instance with added values
Defined in
addEquals()
addEquals(
that
):Point
Adds another point to this one
Parameters
• that: XY
Returns
thisArg
Chainable
Defined in
clone()
clone():
Point
return a cloned instance of the point
Returns
Defined in
distanceFrom()
distanceFrom(
that
):number
Returns distance from this point and another one
Parameters
• that: XY
Returns
number
Defined in
divide()
divide(
that
):Point
Divides this point by another and returns a new one
Parameters
• that: XY
Returns
Defined in
eq()
eq(
that
):boolean
Returns true if this point is equal to another one
Parameters
• that: XY
Returns
boolean
Defined in
gt()
gt(
that
):boolean
Returns true if this point is greater another one
Parameters
• that: XY
Returns
boolean
Defined in
gte()
gte(
that
):boolean
Returns true if this point is greater than or equal to another one
Parameters
• that: XY
Returns
boolean
Defined in
lerp()
lerp(
that
,t
):Point
Returns new point which is the result of linear interpolation with this one and another one
Parameters
• that: XY
• t: number
= 0.5
, position of interpolation, between 0 and 1 default 0.5
Returns
Defined in
lt()
lt(
that
):boolean
Returns true if this point is less than another one
Parameters
• that: XY
Returns
boolean
Defined in
lte()
lte(
that
):boolean
Returns true if this point is less than or equal to another one
Parameters
• that: XY
Returns
boolean
Defined in
max()
max(
that
):Point
Returns a new point which is the max of this and another one
Parameters
• that: XY
Returns
Defined in
midPointFrom()
midPointFrom(
that
):Point
Returns the point between this point and another one
Parameters
• that: XY
Returns
Defined in
min()
min(
that
):Point
Returns a new point which is the min of this and another one
Parameters
• that: XY
Returns
Defined in
multiply()
multiply(
that
):Point
Multiplies this point by another value and returns a new one
Parameters
• that: XY
Returns
Defined in
rotate()
rotate(
radians
,origin
):Point
Rotates point
around origin
with radians
Parameters
• radians: TRadian
The radians of the angle for the rotation
• origin: XY
= ZERO
The origin of the rotation
Returns
The new rotated point
Static
Member Of
fabric.util
Defined in
scalarAdd()
scalarAdd(
scalar
):Point
Adds value to this point and returns a new one
Parameters
• scalar: number
Returns
new Point with added value
Defined in
scalarAddEquals()
scalarAddEquals(
scalar
):Point
Adds value to this point
Parameters
• scalar: number
Returns
thisArg
Chainable
Defined in
scalarDivide()
scalarDivide(
scalar
):Point
Divides this point by a value and returns a new one
Parameters
• scalar: number
Returns
Defined in
scalarDivideEquals()
scalarDivideEquals(
scalar
):Point
Divides this point by a value
Parameters
• scalar: number
Returns
thisArg
Chainable
Defined in
scalarMultiply()
scalarMultiply(
scalar
):Point
Multiplies this point by a value and returns a new one
Parameters
• scalar: number
Returns
Defined in
scalarMultiplyEquals()
scalarMultiplyEquals(
scalar
):Point
Multiplies this point by a value
Parameters
• scalar: number
Returns
thisArg
Chainable
Defined in
scalarSubtract()
scalarSubtract(
scalar
):Point
Subtracts value from this point and returns a new one
Parameters
• scalar: number
Returns
Defined in
scalarSubtractEquals()
scalarSubtractEquals(
scalar
):Point
Subtracts value from this point
Parameters
• scalar: number
Returns
thisArg
Chainable
Defined in
setFromPoint()
setFromPoint(
that
):Point
Sets x/y of this point from another point
Parameters
• that: XY
Returns
Chainable
Defined in
setX()
setX(
x
):Point
Sets x of this point
Parameters
• x: number
Returns
Chainable
Defined in
setXY()
setXY(
x
,y
):Point
Sets x/y of this point
Parameters
• x: number
• y: number
Returns
Chainable
Defined in
setY()
setY(
y
):Point
Sets y of this point
Parameters
• y: number
Returns
Chainable
Defined in
subtract()
subtract(
that
):Point
Subtracts another point from this point and returns a new one
Parameters
• that: XY
Returns
new Point object with subtracted values
Defined in
subtractEquals()
subtractEquals(
that
):Point
Subtracts another point from this point
Parameters
• that: XY
Returns
thisArg
Chainable
Defined in
swap()
swap(
that
):void
Swaps x/y of this point and another point
Parameters
• that: XY
Returns
void
Defined in
toString()
toString():
string
Returns string representation of this point
Returns
string
Defined in
transform()
transform(
t
,ignoreOffset
?):Point
Apply transform t to point p
Parameters
• t: TMat2D
The transform
• ignoreOffset?: boolean
= false
Indicates that the offset should not be applied
Returns
The transformed point
Static
Member Of
fabric.util