Skip to content

Instantly share code, notes, and snippets.


Ryan Branch ryanbranch

View GitHub Profile
View tzprofiles gist 20220915
I am attesting that this GitHub handle ryanbranch is linked to the Tezos account tz1gMpzDGSKJu523tta1zf1YEBuzA6sdwdsG for tzprofiles
ryanbranch /
Created November 21, 2021 03:44
Keybase Proof for GitHub

Keybase proof

I hereby claim:

  • I am ryanbranch on github.
  • I am ryanbranch ( on keybase.
  • I have a public key ASDKxulKs-CYFtKpq203zX8sp_ppHLf4S6keExueI_-TDwo

To claim this, I am signing this object:

View gist:035c8643d5d36421b80f45cf6a9759f5
ryanbranch /
Last active February 28, 2022 00:01
Fitting a Plane to Points in Python
import numpy
from numba import jit
# Calculates the A, B, C, D coefficients of a normalized plane which best fits a dataset
# Based on an approach by Emil Ernerfeldt, titled "Fitting a plane to noisy points in 3D"
# (
# Written by Ryan Branch on 2020/10/25. See
# INPUTS: A 2D Numpy float array of arbitrary outer length, and inner length 3 for (x, y, z) of N points
# OUTPUTS: A 4-tuple of floats A, B, C, and D such that (Ax + By + Cz + D == 0)
# (Returns None if no single valid solution exists)