Cover.piece.of: def of gralha-coverage@0.1.0.1 Import: import gralha-coverage@0.1.0.1/cover.bend as Cover Lines 610-616 of gralha-coverage@0.1.0.1/cover.bend: https://jend.leeeet.dev/read.txt?path=gralha-coverage@0.1.0.1/cover.bend&start_line=610&end_line=616 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def piece.of(l: CovLine) -> Piece: CovLine{x0, y0, x1, y1} = l +ax = x0 +ay = y0 +bx = x1 +by = y1 Piece{ax, ay, ((bx - ax) / (by - ay) : F32), U.min(ay, by), U.max(ay, by), U.choose(F32, F32.is_lt(ay, by), 1.0, F32.neg(1.0))} Uses (10): 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_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=CovLine https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=Piece https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=max https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=min