Skip to content

Instantly share code, notes, and snippets.

View phivk's full-sized avatar
On a boat

Philo van Kemenade phivk

On a boat
View GitHub Profile
@phivk
phivk / catmullFitter.js
Created June 15, 2017 14:36 — forked from nicholaswmin/catmull-rom.js
Catmull Rom Fitting Algorithm in Javascript through a series of X/Y Points
/**
* Interpolates a Catmull-Rom Spline through a series of x/y points
* Converts the CR Spline to Cubic Beziers for use with SVG items
*
* If 'alpha' is 0.5 then the 'Centripetal' variant is used
* If 'alpha' is 1 then the 'Chordal' variant is used
*
*
* @param {Array} data - Array of points, each point in object literal holding x/y values
* @return {String} d - SVG string with cubic bezier curves representing the Catmull-Rom Spline

Honeycomb Icecream Supply Chain

Data Model, most directly copied from MCR site