ixfx
    Preparing search index...
    • Applies fn to both start and end points.

      // Line 10,10 -> 20,20
      const line = Lines.fromNumbers(10,10, 20,20);

      // Applies randomisation to both x and y.
      const rand = (p) => ({
      x: p.x * Math.random(),
      y: p.y * Math.random()
      });

      // Applies our randomisation function
      const line2 = apply(line, rand);

      Parameters

      • line: Line

        Line

      • fn: (p: Point) => Point

        Function that takes a point and returns a point

      Returns Readonly<Line>