aboutsummaryrefslogtreecommitdiff
path: root/src/arc.ml
diff options
context:
space:
mode:
authorJoris2021-05-13 14:50:51 +0200
committerJoris2021-05-13 14:58:26 +0200
commit221b6451fb4f8559a10e7fefebd13ce125ef29d0 (patch)
tree3ab337b7b2d40e8235f887046a580b0850540f11 /src/arc.ml
parent5c636f11cdfed82634ee572645d765b704941b68 (diff)
downloadtabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.tar.gz
tabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.tar.bz2
tabata-221b6451fb4f8559a10e7fefebd13ce125ef29d0.zip
Rewrite in TypeScript
BuckleScript is no longer maintained. Choose a widely used techno that will still be maintained in the following years.
Diffstat (limited to 'src/arc.ml')
-rw-r--r--src/arc.ml23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/arc.ml b/src/arc.ml
deleted file mode 100644
index 7a3195d..0000000
--- a/src/arc.ml
+++ /dev/null
@@ -1,23 +0,0 @@
-let polarToCartesian centerX centerY radius angleInDegrees =
- let angleInRadians = (angleInDegrees -. 90.0) *. Js.Math._PI /. 180.0 in
- ( centerX +. (radius *. Js.Math.cos angleInRadians),
- centerY +. (radius *. Js.Math.sin angleInRadians) )
-
-let describe x y radius startAngle endAngle =
- let startX, startY = polarToCartesian x y radius endAngle in
- let endX, endY = polarToCartesian x y radius startAngle in
- let largeArcFlag = if endAngle -. startAngle <= 180.0 then "0" else "1" in
- [|
- "M";
- Js.Float.toString startX;
- Js.Float.toString startY;
- "A";
- Js.Float.toString radius;
- Js.Float.toString radius;
- "0";
- largeArcFlag;
- "0";
- Js.Float.toString endX;
- Js.Float.toString endY;
- |]
- |> Js.Array.joinWith " "