Skip to content

Instantly share code, notes, and snippets.

@kubijo
kubijo / d3.flow.js
Last active July 10, 2020 09:22
flow types for several D3 APIs
// @flow
/* eslint-disable no-use-before-define */
//
// Primitives
//
type x = number;
type y = number;
type dx = number;
type dy = number;
@tunght13488
tunght13488 / quadratic-bezier.js
Last active December 15, 2023 10:13
quadratic bezier curve length in javascript
/*
* http://en.wikipedia.org/wiki/B%C3%A9zier_curve
* http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/g
*/
function Point(x, y) {
this.x = x;
this.y = y;
}