Quadric implementation, tests