Moving points around a line

조회 수: 1 (최근 30일)
Doina Gumeniuc
Doina Gumeniuc 2017년 10월 29일
편집: Roger Stafford 2017년 10월 30일
Hi dear users, I have a following question: There are some points (3 coordinates each) which form a center line. I have other points which form a shape and I would like to transfer this coordinates along the line mentioned previously. How can I do this with matlab? Thank you!
  댓글 수: 1
Rik
Rik 2017년 10월 29일
Have a read here and here. It will greatly improve your chances of getting an answer.

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

답변 (1개)

Roger Stafford
Roger Stafford 2017년 10월 29일
편집: Roger Stafford 2017년 10월 30일
I assume that by “to transfer this coordinates along the line” you mean you wish to project each such point in the “shape” orthogonally onto the given center line.
Suppose two points along your “center” line are P1 = [x1,y1,z1] and P2 = [x2,y2,z2], and suppose Q1 = [x3,y3,z3] is a point on your shape. Its orthogonal projection, Q2, onto the line P1P2 is given by:
Q2 = P1 + dot(P2-P1,Q1-P1)/dot(P2-P1,P2-P1)*(P2-P1);
('Orthogonal' means that the line Q2Q1 will be perpendicular to line P2P1.)

카테고리

Help CenterFile Exchange에서 Computational Geometry에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by