필터 지우기
필터 지우기

Tangent line between 2 points in 3D

조회 수: 6 (최근 30일)
Oniv
Oniv 2016년 8월 3일
답변: Rodrigo Perea 2017년 9월 14일
Hi!
I want to determine a tangent between 2 points in 3D, that means I have x,y,z coordinates. Polyfit and other similar function don't work. I am a complete beginner. So I hope you can help me.
Oniv

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2016년 8월 3일
Well, you get the equation for the line between 2 points like this:
r1 = [x1,y1,z1]; % First point
r2 = [x2,y2,z2]; % second point
e1_2_2 = r2-r1; % array pointing from r1 towards r2 - to unit vector along line
l1_2_2 = norm(e1_2_2); % length between points
e1_2_2 = e1_2_2/l1_2_2; % unit vector along line
% Then the equation for the line between the points are
r_on_line = r1 + l*e1_2_2; % Where 0<= l <= l1_2_2
HTH

추가 답변 (1개)

Rodrigo Perea
Rodrigo Perea 2017년 9월 14일
I believe your answer give the equation for the line between the 3D points, could you clarify how is this related to the tangent?

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by