Change origin of a mesh

11 visualizzazioni (ultimi 30 giorni)
soukaina krikez
soukaina krikez il 1 Gen 2021
Commentato: Star Strider il 1 Gen 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.

Risposta accettata

Star Strider
Star Strider il 1 Gen 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 Commenti
soukaina krikez
soukaina krikez il 1 Gen 2021
It worked with xshift=200
Thank you so much!
Star Strider
Star Strider il 1 Gen 2021
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Interpolation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by