Skip to content

Instantly share code, notes, and snippets.

View azlen's full-sized avatar

Azlen Elza azlen

View GitHub Profile
@azlen
azlen / bulletpaths.js
Last active April 15, 2024 14:06
All Paths Lead to Roam
/*
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/
*
*/
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
@azlen
azlen / kabsch.js
Last active February 20, 2019 04:32
Kabsch Algorithm
const N = require('numeric');
// centroid
// :: returns mean ~vector~ of m-dimensional vectors in matrix
// A = N x m matrix
function centroid(A) {
return N.div( A.reduce((a,b) => N.add(a,b), [0, 0]), A.length);
}
// kabsch