All Projects → jchavarri → rebez

jchavarri / rebez

Licence: MIT license
Cubic bezier implementation in Reason / OCaml.

Programming Languages

ocaml
1615 projects
shell
77523 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to rebez

reason-vue
ReasonML and Vue
Stars: ✭ 55 (+77.42%)
Mutual labels:  reasonml
hello-ppx-esy
A simple example of a ppx with Reason and esy
Stars: ✭ 38 (+22.58%)
Mutual labels:  reasonml
android-animations
Perform tweened animations such as Attention, Bounce, Fade, Flip, Rotate, Slide and Zoom on Views
Stars: ✭ 118 (+280.65%)
Mutual labels:  easing-functions
gobi
Compile OCaml/Reason to static iOS libraries
Stars: ✭ 25 (-19.35%)
Mutual labels:  reasonml
reasonml-minimal-config
ReasonML minimal webpack config with webpack-dashboard & reports enabled
Stars: ✭ 16 (-48.39%)
Mutual labels:  reasonml
reactor
🚀 Native Actors for Reason and OCaml
Stars: ✭ 70 (+125.81%)
Mutual labels:  reasonml
JsonCodec
JSON combinator library for BuckleScript/Reason
Stars: ✭ 38 (+22.58%)
Mutual labels:  reasonml
bs-css-core
BuckleScript statically typed DSL for CSS (forked from https://github.com/SentiaAnalytics/bs-css)
Stars: ✭ 15 (-51.61%)
Mutual labels:  reasonml
Reason-react-hooks
🧶 Some hooks in ReasonML for reason-react that can be useful
Stars: ✭ 14 (-54.84%)
Mutual labels:  reasonml
BezierCanvas
Adobe Illustrator's pen tool style bezier editor on Unity.
Stars: ✭ 126 (+306.45%)
Mutual labels:  bezier-curve
ppx rapper
Syntax extension for writing SQL in OCaml
Stars: ✭ 91 (+193.55%)
Mutual labels:  reasonml
goopylib
A simple-yet-powerful 2D graphics framework built on top of Tkinter capable of creating good-looking & modern GUIs, games, and simple animations.
Stars: ✭ 19 (-38.71%)
Mutual labels:  easing-functions
bs-Zarith
Support Bigint, Q (rational numbers) and Z (integer numbers) in BuckleScript.
Stars: ✭ 15 (-51.61%)
Mutual labels:  reasonml
bs-immutablejs
Reason + BuckleScript bindings to Immutable.js
Stars: ✭ 28 (-9.68%)
Mutual labels:  reasonml
agda-mode-vscode
agda-mode on VS Code
Stars: ✭ 112 (+261.29%)
Mutual labels:  reasonml
reform
📋 Reasonably making forms sound good
Stars: ✭ 345 (+1012.9%)
Mutual labels:  reasonml
ludigraphix.github.io
Documentation for Ludigraphix
Stars: ✭ 21 (-32.26%)
Mutual labels:  bezier-curve
bs-downshift
BuckleScript bindings for Downshift
Stars: ✭ 21 (-32.26%)
Mutual labels:  reasonml
rescript-jest
ReScript bindings for Jest
Stars: ✭ 274 (+783.87%)
Mutual labels:  reasonml
reason-catstagram
🐈 Catstagram made with ReasonReact!
Stars: ✭ 31 (+0%)
Mutual labels:  reasonml

Build Status

rebez

Cubic bezier implementation in Reason / OCaml.

Adapted from the JavaScript version in https://github.com/gre/bezier-easing.

BezierEasing provides Cubic Bezier Curve easing which generalizes easing functions (ease-in, ease-out, ease-in-out, etc) exactly like in CSS Transitions.

Implementing efficient lookup is not easy because it implies projecting the X coordinate to a Bezier Curve. This micro library uses fast heuristics (involving dichotomic search, newton-raphson, sampling) to focus on performance and precision.

It is heavily based on implementations available in Firefox and Chrome (for the CSS transition-timing-function property).

Install

With esy, add to your package.json:

{
  "dependencies": {
    "rebez": "*",
  },
  "resolutions": {
    "rebez": "github:jchavarri/rebez",
  },
}

Using

In Reason:

let easing = Rebez.make(0., 0.99, 0., 0.99);
// `easing` is a function that can receive values from 0.0 to 1.0
let value = easing(0.01); // 0.512011914581

In OCaml:

let easing = Rebez.make 0. 0.99 0. 0.99
(* `easing` is a function that can receive values from 0.0 to 1.0 *)
let value = easing 0.01  (* 0.512011914581 *)

Developing:

npm install -g esy
git clone https://github.com/jchavarri/rebez/
esy install
esy build

Running Tests:

# Runs the "test" command in `package.json`.
esy test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].