Visgraph.natural_right: def of bend-visgraph@2.0.0.0 Import: import bend-visgraph@2.0.0.0/visgraph.bend as Visgraph Lines 403-415 of bend-visgraph@2.0.0.0/visgraph.bend: https://jend.leeeet.dev/read.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&start_line=403&end_line=415 import Base def natural_right(~x_at: Array -> U32 -> Array & F32, count: Nat, +j: U32, yr: Array & F32, xr: Array & F32, +k: Weight, +lo: F32, +hi: F32, +ia: U32, +xa: F32, +ya: F32, +scale_a: F32, +best: F32, es: Edges, +ahead: U32) -> Walked: match count: case 0n: (ys, yb) = yr (xs, xb) = xr Walked{Array.get(F32, ys, ahead), Array.get(F32, xs, ahead), es} case 1n+c: (ys, +yb) = yr (xs, +xb) = xr +s = F32.div(F32.sub(yb, ya), F32.sub(xb, xa)) +seen = clears(F32.is_gt(s, best), s, best, scale_a, xb, yb) +j2 = (j + 1 : U32) natural_right(~x_at, c, j2, Array.get(F32, ys, j2), x_at(xs, j2), k, lo, hi, ia, xa, ya, scale_a, pick(seen, s, best), add_right(seen, k, lo, hi, ia, j, xa, xb, ya, yb, s, es), ahead) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=Edges https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=Walked https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=Weight https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=add_right https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=clears https://jend.leeeet.dev/definition.txt?path=bend-visgraph@2.0.0.0/visgraph.bend&name=pick