0 | module Geom.Interpolate
8 | round : Nat -> Double -> Double
10 | let f := pow 10 (cast n)
14 | in if dd - df < dc - dd then df/f else dc/f
17 | Interpolation Angle where
18 | interpolate a = "\{show $ round 1 $ toDegree a}°"
21 | Interpolation Double where
22 | interpolate = show . round 3
25 | Interpolation (Point t) where
26 | interpolate (P x y) = "x: \{x}, y: \{y}"
29 | Interpolation (Vector t) where
30 | interpolate (V x y) = "vx: \{x}, vy: \{y}"
33 | Interpolation (Fin k) where
37 | Interpolation (List $
Fin k) where
41 | Interpolation Bounds where
42 | interpolate = maybe "[]" (\p => "[\{fst p}, \{snd p}]") . getBounds
45 | Interpolation (Bounds2D t) where
46 | interpolate (BS x y) = "x: \{x}, y: \{y}"