Align Z axis so it is always perpendicular

This may well be a very simple (and simple) question. So I'll apologise in advance. The question in relating to a discussion I had with someone.
Consider the fact that we have 3D orthogonal vector, consider that it may be a time series.
f1 = = [ -0.1408 -0.3257 2.1674]
How would you go about aligning the vector so that it is always perpendicular to Z axis.
Thanks

 채택된 답변

Roger Stafford
Roger Stafford 2014년 9월 6일

2 개 추천

Set its third component to zero:
f1(3) = 0;
Of course that shortens the vector. If you want to preserve its vector length,
n = norm(f1);
f1(3) = 0;
f1 = f1*(n/norm(f1));

댓글 수: 1

Dan
Dan 2014년 9월 6일
Roger,
Once again you've come to the rescue. I'm frustrated that the answer was to simple. I did consider you response beforehand, but I assumed that wasn't the case. Thank you for taking the time to reply.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Polar Plots에 대해 자세히 알아보기

질문:

Dan
2014년 9월 6일

댓글:

Dan
2014년 9월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by