Skip to content

Instantly share code, notes, and snippets.

View caudamus's full-sized avatar

Caudamus caudamus

  • San Francisco, CA
View GitHub Profile
@caudamus
caudamus / geom.py
Last active November 28, 2018 23:13
Tensegrity Design Analysis
#!/usr/bin/env python
import numpy as np
from collections import OrderedDict
from scipy.optimize import LinearConstraint, minimize, BFGS
def normlen(v):
''' length of norm of a vector '''
return np.sqrt(np.sum(np.square(v)))
@caudamus
caudamus / README.md
Last active February 28, 2024 13:30
BNF Parser

BNF parsing

Toy weekend project: make a parser-parser!

This takes in a grammar given in Bakus-Naur Form (BNF), and a program that was written in the provided grammar, and produces an image of Syntax Tree using graphviz.

References:

#!/usr/bin/env python
from math import atan2, pi, sqrt
'''
Our goal is to figure out an analytic formulation of the area the goat can reach.
*Note:* We'll take advantage of symmetry to only solve the top half of the area.
We have two circles which intersect: