And cones !

This commit is contained in:
Godzil
2020-02-23 02:31:30 +00:00
parent 0650ac7b44
commit f226664fe3
9 changed files with 509 additions and 3 deletions

View File

@@ -19,6 +19,11 @@ double Tuple::magnitude()
Tuple Tuple::normalise()
{
double mag = this->magnitude();
if (mag == 0)
{
return Tuple(0, 0, 0, 0);
}
return Tuple(this->x / mag, this->y / mag, this->z / mag, this->w / mag);
}