Creates a Vec2 from an object containing x and y coordinates.

import { Vec2 } from '@js-draw/math';
const v1 = Vec2.ofXY({ x: 3, y: 4.5 });
const v2 = Vec2.ofXY({ x: -123.4, y: 1 });
  • Parameters

    • __namedParameters: {
          x: number;
          y: number;
      }
      • x: number
      • y: number

    Returns Vec2Impl

OpenSource licenses