def path.arc
gralha-svg-render@0.1.0.1 · svg.bend:401
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
401def path.arc(+p: Path, +q: Point, +cmd: U32, +rx: F32, +ry: F32, phi: F32,
402 large: F32, sweep: F32) -> Path:
403 Path{cur, start, ctrl, old, prev, es, trace, tol} = p
404 U.branch(Path, F32.is_lt(point.distance(cur, q), 0.000001), _ => Path{q, start, q, cmd, 65, es, trace, tol},
405 _ => U.branch(Path, F32.is_eq(rx, 0.0) || F32.is_eq(ry, 0.0), _ => path.line(p, q, cmd),
406 _ => arc.prepare(p, q, cmd, F32.abs(rx), F32.abs(ry), (phi * 0.017453292519943295 : F32),
407 large, sweep, point.scale(point.sub(cur, q), 0.5))))