def piece.of

gralha-coverage@0.1.0.1 · cover.bend:610

import gralha-coverage@0.1.0.1/cover.bend as Cover
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

610def piece.of(l: CovLine) -> Piece:
611  CovLine{x0, y0, x1, y1} = l
612  +ax = x0
613  +ay = y0
614  +bx = x1
615  +by = y1
616  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)

Used by (1)