rapid-sdk
    Preparing search index...

    Function geomReflect

    • Reflect all points across a line axis, without modifying the input points array

      Type Parameters

      Parameters

      • points: T

        Array of points to reflect

      • axis: [Vec2, Vec2]

        reflection axis as [start, end]

      Returns T

      reflected points

      Axis is the infinite line through axis[0] and axis[1].

      const points = [[0, 0], [2, 2], [3, 1]];
      geomReflect(points, [[0, 1], [2, 1]]); // returns [[0, 2], [2, 0], [3, 1]]