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 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Explain Code
: explain the code you input to help you to understand it.

X
0
Would love your thoughts, please comment.x
()
x