createjs.Point Class

Defined in: createjs.Point:8
Module: EaselJS Display

Mixins for the CreateJS Point class, which include methods for calculating the dot product, length, distance, normalize, etc.

add

(
  • other
)

Defined in add:72

Adds the x and y values of a point to this point.

Parameters:

  • other Point

    The point to add to this one

distance

(
  • other
)
Number

Defined in distance:110

Calculates the distance between this and another point.

Parameters:

  • other Point

    The point to calculate the distance to.

Returns:

Number:

The distance.

distanceSq

(
  • other
)
Number

Defined in distanceSq:123

Calculates the squared distance between this and another point.

Parameters:

  • other Point

    The point to calculate the distance to.

Returns:

Number:

The distance squared.

dotProd

(
  • other
)

Defined in dotProd:19

Returns the dot product between this point and another one.

Parameters:

  • other Point

    The point to form a dot product with

Returns:

The dot product between the two points.

length

()

Defined in length:30

Returns the length (or magnitude) of this point.

Returns:

The length of this point.

lengthSq

()

Defined in lengthSq:40

Returns the squared length (or magnitude) of this point. This is faster than length().

Returns:

The length squared of this point.

normalize

()

Defined in normalize:50

Reduces the point to a length of 1.

scaleBy

(
  • value
)

Defined in scaleBy:99

Multiplies the x and y values of this point by a value.

Parameters:

  • value Number

    The value to scale by.

subtract

(
  • other
)

Defined in subtract:61

Subtracts the x and y values of a point from this point.

Parameters:

  • other Point

    The point to subtract from this one

truncate

(
  • maxLength
)

Defined in truncate:83

Truncate the length of the point to a maximum.

Parameters:

  • maxLength Number

    The maximum length to allow in this point.