summaryrefslogtreecommitdiff
path: root/shapes
diff options
context:
space:
mode:
Diffstat (limited to 'shapes')
-rwxr-xr-xshapes/bezier.ml25
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"
+*)