Chalkboard - v3.0.1
    Preparing search index...

    Function fromAngle

    • Converts an angle or two angles to a 2D vector or a 3D vector, respectively.

      Parameters

      • rad1: number

        The only angle (for 2D vectors) or the first angle (for 3D vectors)

      • Optionalrad2: number

        The second angle (for 3D vectors)

      Returns ChalkboardVector

      // Returns (1, 0) (unit vector at 0 radians)
      const v = Chalkboard.vect.fromAngle(0);