diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-03 05:42:35 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2021-01-03 20:19:14 +0100 |
commit | a8f37f041dce3f16917b6659d3ca97492f178f4d (patch) | |
tree | 35223969024c9ebaed7309b5a6299f8de5f18d1f /shapes | |
parent | 20addbe8fd0ac4c79c8a69a4f888ec320a9ca4c3 (diff) |
Communication with webworker
Diffstat (limited to 'shapes')
-rwxr-xr-x | shapes/bezier.ml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shapes/bezier.ml b/shapes/bezier.ml index bf7aaaa..f5f288c 100755 --- a/shapes/bezier.ml +++ b/shapes/bezier.ml @@ -201,3 +201,28 @@ let reverse ; p1 = bezier.p0 ; ctrl0 = bezier.ctrl1 ; ctrl1 = bezier.ctrl0 } + +(** + + see https://github.com/Pomax/BezierInfo-2/blob/master/docs/js/graphics-element/lib/bezierjs/bezier.js#L504 + + let root + : t -> 'a + = fun bezier -> + + let accept + : float -> bool + = fun t -> + 0. <= t && t <= 1. in + + let cuberoot v = + if v < 0. then + Float.pow (Float.neg v) ( 1. /. 3.) + |> Float.neg + else Float.pow v (1. /. 3.) in + + + + + failwith "Non implemented" +*) |