D Paste by joecoder
Description: None
Hide line numbers

Create new paste
Post a reply
View replies

Paste:
1  
2  
3  
4  
5  
6  
// scale() scales a vector by its input
// dot() is the dot product of this vector and another
// lengt2() returns the length of the vector squared.
Vec3f projection(Vec3f s)
{    return s.scale(dot(s)/s.length2());
}

Replies:
Reply by joecoder
A
/
/
/
/===C_________B

    (some replies deleted)