Add nodes (3D) placed at a distance H from starting nodes (3D)

조회 수: 1 (최근 30일)
Alberto Acri
Alberto Acri 2023년 9월 29일
댓글: Walter Roberson 2023년 9월 30일
Hi! Is there any way to generate other red coordinates on the same plane and with a distance H = 0.1 from the black coordinates ?
C_or = importdata("C1_or.mat");
C_new = importdata("C1_new.mat");
P = [25.9349 -15.0445 77.3427];
% C_or = importdata("C3_or.mat");
% C_new = importdata("C3_new.mat");
% P = [28.73645 -15.2786 69.24005];
figure
plot3(P(:,1),P(:,2),P(:,3),'k*','Markersize',20);
hold on
plot3(C_or(:,1),C_or(:,2),C_or(:,3),'k.','Markersize',10);
plot3(C_new(:,1),C_new(:,2),C_new(:,3),'r.','Markersize',10);
hold off
axis equal
The second figure is the expected result.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 9월 29일
For any particular grouping:
Subtract the mean() of the coordinates in order to shift the coordinates to be relative to the centroid. Then use cart2pol to get angle and distance relative to the centroid. Add the offset to the distance, and then pol2cart . Add back the coordinates of the centroid to get the new coordinates.
  댓글 수: 3
Alberto Acri
Alberto Acri 2023년 9월 30일
Hi @Walter Roberson, can you provide me with some of code?

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

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by