def penetrable.points

bend-visgraph@2.0.0.0 · visgraph.bend:582

import bend-visgraph@2.0.0.0/visgraph.bend as Visgraph
import Base

582# The points of `ys` and `xs` from index `i` down to 0, onto `acc`; `yr`
583# and `xr` hold y and x at `i`, and x is the index if `index` says so. The
584# last read, at index -1, wraps around.
585def penetrable.points(count: Nat, +i: U32, yr: Array<F32> & F32, xr: Array<F32> & F32, +index: Bool, acc: Pts) -> Pts:
586  match count:
587    case 0n:
588      (ys, y) = yr
589      (xs, x) = xr
590      acc
591    case 1n+c:
592      (ys, +y) = yr
593      (xs, +x) = xr
594      +i2 = (i - 1 : U32)
595      penetrable.points(c, i2, Array.get(F32, ys, i2), Array.get(F32, xs, i2), index, PCon{i, pick(index, U32.to_f32(i), x), y, acc})

Uses (12)

Used by (1)