A math library for 2d and 3d drawing calculations