Registered Member
|
Hello!
Iam searching for a smart way to make 2 vectors, which have the same origin, perpendicular. One method would be to do the cross product twice, but i hope there is a better way. greetings from germany! |
Moderator
|
Are your vectors unit vectors? Do you want to preserve their length? Do you want to keep the first one fixed?
Anyway, an alternative to two cross product is to project the second one on the plane orthogonal to the first one, e.g.,
This returns a unit vector, and if v1 is unit, then you can avoid the normalization by /v1.squaredNorm(). |
Registered Member
|
Hi,
maybe some more informations from my side would be appropriate. sorry for that. Yes you guessed it right. The two vectors are unit vectors and one should be fixed. Ive done it before with a twice cross product, but if one vector was on an axis it doesnt worked, because the cross product didnt get along with the zeros. Your solution seems fine! Thank you again Sir! greetings Benni |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]