Added some 3d math functions from the internets. See if anything is useful…