We want to calculate a new vector that has no weight on the special axis.
Calculate the projected vector on the special axis and remove it, the result is what we want.

PointStruct CalculateVectorWeight(PointStruct vec0, PointStruct vec1)
{
    vec0.Unit();
    double dotValue = vec1.Dot( vec0 );
    PointStruct onVec0 = vec0 * dotValue;
    PointStruct newVec = vec1 - onVec0;
    return newVec;
}



Categories: Math

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page