rapid-sdk
    Preparing search index...

    Function geomScale

    • Scale all points relative to an origin point, without modifying the input points array

      Type Parameters

      Parameters

      • points: T

        Array of points to scale

      • scaleFactor: number

        scale factor (1 keeps size unchanged)

      • origin: Vec2

        origin point

      Returns T

      scaled points

      const points = [[1, 0], [2, 0]];
      const origin = [0, 0];
      geomScale(points, 2, origin); // returns [[2, 0], [4, 0]]