Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (17 sloc) 287 Bytes
//
// math3D.cpp
// VolumeRenderer
//
// Created by Calvin Loncaric on 6/26/11.
//
#include "math3D.h"
#include <cmath>
#include <cassert>
void normalize(Vector3D& v)
{
float l = sqrtf(v.x*v.x + v.y*v.y + v.z*v.z);
assert(l > 0);
v.x /= l;
v.y /= l;
v.z /= l;
}