Angles of line with respect to origin axis in 3D
조회 수: 7 (최근 30일)
이전 댓글 표시
There is an point at [xp,yp,zp].
Its origin at [xc,yc,zc].
I need angles of line from [xc,yc,zc] to [xp,yp,zp] with respect to axes of origin as shown below.
댓글 수: 0
채택된 답변
Fernando González
2017년 7월 2일
I think I posted it as a comment before instead of as an answer u.u'
gamma = atan(sqrt(((xp-xc)^2+(yp-yc)^2)/(zp-zc));
alpha = atan(sqrt(((zp-zc)^2+(yp-yc)^2)/(xp-xc));
beta = atan(sqrt(((xp-xc)^2+(zp-zc)^2)/(yp-yc));
Results in radians ofc.
Hope this is what you asked.
Fer
댓글 수: 1
Linus Olofsson
2022년 6월 28일
Just to clarify (please correct me if I'm wrong), these equations show the angles of the black arrow to each respective axis as they appear in 3D, and NOT as a projction to each plane.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!