rapid-sdk
    Preparing search index...

    Function geomRotate

    • Rotate all points counterclockwise around a pivot point by given angle (in radians), without modifying the input points array

      Type Parameters

      Parameters

      • points: T

        Array of points to rotate

      • angle: number

        angle in radians

      • origin: Vec2

        pivot point

      Returns T

      rotated points

      const points = [[1, 0], [1, 1]];
      const origin = [0, 0];
      geomRotate(points, Math.PI, origin); // returns [[-1, 0], [-1, -1]]