Skip to content

Point

Adaptation of work of Kevin Lindsey(kevin@kevlindev.com)

Implements

Constructors

new Point()

new Point(): Point

Returns

Point

Defined in

src/Point.ts:18

new Point()

new Point(x, y): Point

Parameters

x: number

y: number

Returns

Point

Defined in

src/Point.ts:19

new Point()

new Point(point?): Point

Parameters

point?: XY

Returns

Point

Defined in

src/Point.ts:20

Properties

x

x: number

Implementation of

XY.x

Defined in

src/Point.ts:14


y

y: number

Implementation of

XY.y

Defined in

src/Point.ts:16

Methods

add()

add(that): Point

Adds another point to this one and returns another one

Parameters

that: XY

Returns

Point

new Point instance with added values

Defined in

src/Point.ts:36


addEquals()

addEquals(that): Point

Adds another point to this one

Parameters

that: XY

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:47


clone()

clone(): Point

return a cloned instance of the point

Returns

Point

Defined in

src/Point.ts:347


distanceFrom()

distanceFrom(that): number

Returns distance from this point and another one

Parameters

that: XY

Returns

number

Defined in

src/Point.ts:246


divide()

divide(that): Point

Divides this point by another and returns a new one

Parameters

that: XY

Returns

Point

Defined in

src/Point.ts:155


eq()

eq(that): boolean

Returns true if this point is equal to another one

Parameters

that: XY

Returns

boolean

Defined in

src/Point.ts:186


gt()

gt(that): boolean

Returns true if this point is greater another one

Parameters

that: XY

Returns

boolean

Defined in

src/Point.ts:214


gte()

gte(that): boolean

Returns true if this point is greater than or equal to another one

Parameters

that: XY

Returns

boolean

Defined in

src/Point.ts:223


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

Point

Defined in

src/Point.ts:233


lt()

lt(that): boolean

Returns true if this point is less than another one

Parameters

that: XY

Returns

boolean

Defined in

src/Point.ts:195


lte()

lte(that): boolean

Returns true if this point is less than or equal to another one

Parameters

that: XY

Returns

boolean

Defined in

src/Point.ts:204


max()

max(that): Point

Returns a new point which is the max of this and another one

Parameters

that: XY

Returns

Point

Defined in

src/Point.ts:275


midPointFrom()

midPointFrom(that): Point

Returns the point between this point and another one

Parameters

that: XY

Returns

Point

Defined in

src/Point.ts:257


min()

min(that): Point

Returns a new point which is the min of this and another one

Parameters

that: XY

Returns

Point

Defined in

src/Point.ts:266


multiply()

multiply(that): Point

Multiplies this point by another value and returns a new one

Parameters

that: XY

Returns

Point

Defined in

src/Point.ts:124


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

Point

The new rotated point

Static

Member Of

fabric.util

Defined in

src/Point.ts:359


scalarAdd()

scalarAdd(scalar): Point

Adds value to this point and returns a new one

Parameters

scalar: number

Returns

Point

new Point with added value

Defined in

src/Point.ts:58


scalarAddEquals()

scalarAddEquals(scalar): Point

Adds value to this point

Parameters

scalar: number

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:69


scalarDivide()

scalarDivide(scalar): Point

Divides this point by a value and returns a new one

Parameters

scalar: number

Returns

Point

Defined in

src/Point.ts:164


scalarDivideEquals()

scalarDivideEquals(scalar): Point

Divides this point by a value

Parameters

scalar: number

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:175


scalarMultiply()

scalarMultiply(scalar): Point

Multiplies this point by a value and returns a new one

Parameters

scalar: number

Returns

Point

Defined in

src/Point.ts:133


scalarMultiplyEquals()

scalarMultiplyEquals(scalar): Point

Multiplies this point by a value

Parameters

scalar: number

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:144


scalarSubtract()

scalarSubtract(scalar): Point

Subtracts value from this point and returns a new one

Parameters

scalar: number

Returns

Point

Defined in

src/Point.ts:102


scalarSubtractEquals()

scalarSubtractEquals(scalar): Point

Subtracts value from this point

Parameters

scalar: number

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:113


setFromPoint()

setFromPoint(that): Point

Sets x/y of this point from another point

Parameters

that: XY

Returns

Point

Chainable

Defined in

src/Point.ts:324


setX()

setX(x): Point

Sets x of this point

Parameters

x: number

Returns

Point

Chainable

Defined in

src/Point.ts:304


setXY()

setXY(x, y): Point

Sets x/y of this point

Parameters

x: number

y: number

Returns

Point

Chainable

Defined in

src/Point.ts:293


setY()

setY(y): Point

Sets y of this point

Parameters

y: number

Returns

Point

Chainable

Defined in

src/Point.ts:314


subtract()

subtract(that): Point

Subtracts another point from this point and returns a new one

Parameters

that: XY

Returns

Point

new Point object with subtracted values

Defined in

src/Point.ts:80


subtractEquals()

subtractEquals(that): Point

Subtracts another point from this point

Parameters

that: XY

Returns

Point

thisArg

Chainable

Defined in

src/Point.ts:91


swap()

swap(that): void

Swaps x/y of this point and another point

Parameters

that: XY

Returns

void

Defined in

src/Point.ts:334


toString()

toString(): string

Returns string representation of this point

Returns

string

Defined in

src/Point.ts:283


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

Point

The transformed point

Static

Member Of

fabric.util

Defined in

src/Point.ts:380