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

// Returns (1, 0) (unit vector at 0 radians)
const v = Chalkboard.vect.fromAngle(0);
  • 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