Implement ray, vector and quad functions