phaser - v3.90.0
    Preparing search index...

    Class VectorFactory

    Index

    Constructors

    Methods

    • Returns the angle in radians between the two vectors relative to the x-axis.

      Parameters

      Returns number

      The angle in radians

      angle

    • Creates a new vector.

      Parameters

      • Optionalx: number
      • Optionaly: number

      Returns MatterJS.Vector

      A new vector

      create

    • Returns the magnitude (length) of a vector.

      Parameters

      Returns number

      The magnitude of the vector

      magnitude

    • Returns the magnitude (length) of a vector (therefore saving a sqrt operation).

      Parameters

      Returns number

      The squared magnitude of the vector

      magnitudeSquared

    • Returns the perpendicular vector. Set negate to true for the perpendicular in the opposite direction.

      Parameters

      Returns MatterJS.Vector

      The perpendicular vector

      perp