Change origin of a mesh

3 次查看(过去 30 天)
Hello,
I would like to chane the origin of this mesh:
to put the origin0 at the coordiante : -200 ,any ideas for it?
Here is the code of the mesh:
rows=257;
columns=251;
x=0:40:columns.*3/4;
xmin=x-1;
theta=(0:5:360)*pi/180;
[th,X]=meshgrid(theta,xmin);
th2=size(th)
X2=size(X)
A=X.*cos(th);
B=X.*sin(th);
C=zeros(X2(1),th2(2));
T2 = delaunay(A,B);
trimesh(T2,A,B,C);
view(0,90)
Thank you.

采纳的回答

Star Strider
Star Strider 2021-1-1
Try this:
rows=257;
columns=251;
x=0:40:columns.*3/4;
xmin=x-1;
theta=(0:5:360)*pi/180;
[th,X]=meshgrid(theta,xmin);
th2=size(th)
X2=size(X)
xshift = -200; % Shift ‘x’ Origin Of Mesh
yshift = 0; % Shift ‘y’ Origin Of Mesh
A=X.*cos(th) + xshift;
B=X.*sin(th) + yshift;
C=zeros(X2(1),th2(2));
T2 = delaunay(A,B);
trimesh(T2,A,B,C);
view(0,90)
axis equal
.
  2 个评论
Matthew Worker
Matthew Worker 2021-1-1
It worked with xshift=200
Thank you so much!
Star Strider
Star Strider 2021-1-1
As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

类别

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