Change origin of a mesh
3 views (last 30 days)
Show older comments
Matthew Worker
on 1 Jan 2021
Commented: Star Strider
on 1 Jan 2021
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.
0 Comments
Accepted Answer
Star Strider
on 1 Jan 2021
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 Comments
More Answers (0)
See Also
Categories
Find more on Computational Geometry in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!