필터 지우기
필터 지우기

translation matrix in OXY plane

조회 수: 4 (최근 30일)
ha ha
ha ha 2018년 11월 30일
편집: ha ha 2018년 11월 30일
Let's say: I have matrix A=[x y z] with ~3.000 point data . Please see attachment file, and figure:
My question is: how can I translate all points with distance 1 in the black arrow direction (// with the long edge of the points), as illustrate figure?
download.jpg

채택된 답변

KSSV
KSSV 2018년 11월 30일
편집: KSSV 2018년 11월 30일
You need to add that value to the coordinates. If you want to move along x-axes add 1 unit to x coordinates.
data = importdata('A.txt') ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
plot3(x,y,z,'.r')
hold on
%% Translate along x axis by unit 1
dx = 1. ;
x = x+dx ;
plot3(x,y,z,'.b')
view(2)
  댓글 수: 4
KSSV
KSSV 2018년 11월 30일
data = importdata('A.txt') ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
plot(x,y,'.r')
hold on
%%
idx = boundary(x,y) ;
p = polyshape(x(idx),y(idx)) ;
v = p.Vertices(1:2,:) ;
v = diff(v) ;
u = -0.1 ; % move by this unit
x = x+u*v(1) ; y = y+u*v(2) ;
plot(x,y,'.b')
ha ha
ha ha 2018년 11월 30일
편집: ha ha 2018년 11월 30일
Thanks @ KSSV .
You are correct.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by