Vector projection function
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I didn't see anything like this in vtkMath, does it exist somewhere else? Or can this be added somewhere?
void Project(const double* A, const double* B, double* Projection)
{
//find the projection of A on B
double scale = vtkMath::Dot(A,B)/pow(vtkMath::Norm(B), 2);
for(unsigned int i = 0; i < 3; i++)
Projection[i] = scale * B[i];
}
A "ProjectVectorOnPlane" function would probably also be useful.