Inverts one or more axis of a point

invert({x:10, y:10}); // Yields: {x:-10, y:-10}
invert({x:10, y:10}, `x`); // Yields: {x:-10, y:10}
  • Parameters

    • pt: Point | Point3d

      Point to invert

    • what:
          | "x"
          | "y"
          | "z"
          | "both" = ...

      Which axis. If unspecified, both axies are inverted

    Returns Point