diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-07 00:03:03 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-07 00:03:03 +0100 |
commit | 06c39bbea3b7f8e6bfec88878ec80f9cc474184f (patch) | |
tree | 6394250ec5795f9b718595cf409b49517ab98759 /path/point.ml | |
parent | a63662059215a26db627c4b76147a3c9338f5b74 (diff) |
Update
Diffstat (limited to 'path/point.ml')
-rwxr-xr-x | path/point.ml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/path/point.ml b/path/point.ml index 046c2e7..d49d655 100755 --- a/path/point.ml +++ b/path/point.ml @@ -45,3 +45,20 @@ let get_coord' let open Gg.V2 in let trans = of_polar @@ v t.size t.angle in t.p + trans + +let mix + : float -> Gg.v2 -> t -> t -> t + = fun f point p0 p1 -> + let angle0 = p0.angle + and angle1 = p1.angle + and width0 = get_width p0 + and width1 = get_width p1 + and stamp0 = get_stamp p0 + and stamp1 = get_stamp p1 in + let angle = angle0 +. f *. ( angle1 -. angle0 ) in + let width = width0 +. f *. ( width1 -. width0 ) in + let stamp = stamp0 +. f *. ( stamp1 -. stamp0 ) in + { p = point + ; size = width + ; angle + ; stamp } |