Diferencia entre revisiones de «Dibujar un sólido 2-D»
De MateWiki
| (No se muestran 34 ediciones intermedias de 2 usuarios) | |||
| Línea 1: | Línea 1: | ||
| + | [[Archivo:Mallado1.jpg|400px|thumb|right|Mesh in a rectangular solid]] | ||
| + | |||
We show how to draw meshes of plane regions, representing solids, with Octave UPM. The objective is to be able of visualizing physical quantities in the mesh points. We start with the simplest example, the rectangle <math> [-1/2,1/2]\times [0,2]</math>. We follow the steps: | We show how to draw meshes of plane regions, representing solids, with Octave UPM. The objective is to be able of visualizing physical quantities in the mesh points. We start with the simplest example, the rectangle <math> [-1/2,1/2]\times [0,2]</math>. We follow the steps: | ||
# We introduce a sampling of the two segments with a suitable step | # We introduce a sampling of the two segments with a suitable step | ||
| − | # With meshgrid command we define two matrixes with the x and y | + | # With meshgrid command we define two matrixes with the x and y coordinates of the mesh points |
# We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top. | # We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top. | ||
| − | |||
== MATLAB code == | == MATLAB code == | ||
{{matlab|codigo= | {{matlab|codigo= | ||
| − | x=-0.5:0.1:0.5; % sampling of the interval [-1/2,1/2]y=0:0.1:2; % sampling of the interval [0,2][xx,yy]=meshgrid(x,y); % matrixes of x and y | + | x=-0.5:0.1:0.5; % sampling of the interval [-1/2,1/2] |
| + | y=0:0.1:2; % sampling of the interval [0,2] | ||
| + | [xx,yy]=meshgrid(x,y); % matrixes of x and y coordinates | ||
| + | figure(1) | ||
| + | mesh(xx,yy,0*xx) % Draw the mesh | ||
| + | axis([-2,2,-1,3]) % select region for drawing | ||
| + | view(2) % See the picture from the top | ||
}} | }} | ||
| + | |||
| + | |||
| + | |||
| + | == To go further == | ||
| + | |||
| + | [[Mesh of a parametrized 2-D solid]] | ||
| + | |||
| + | [[Visualization of a scalar field in a solid]] | ||
| + | |||
| + | [[Visualization of vector fields in a solid]] | ||
| + | |||
| + | [[Level sets of a scalar field]] | ||
[[Categoría:Curso ICE]] | [[Categoría:Curso ICE]] | ||
| + | [[Categoría:Teoría de Campos]] | ||
| + | [[Categoría:TC25/26]] | ||
| + | [[Categoría:Informática]] | ||
Revisión actual del 20:14 25 nov 2025
We show how to draw meshes of plane regions, representing solids, with Octave UPM. The objective is to be able of visualizing physical quantities in the mesh points. We start with the simplest example, the rectangle [math] [-1/2,1/2]\times [0,2][/math]. We follow the steps:
- We introduce a sampling of the two segments with a suitable step
- With meshgrid command we define two matrixes with the x and y coordinates of the mesh points
- We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top.
1 MATLAB code
x=-0.5:0.1:0.5; % sampling of the interval [-1/2,1/2]
y=0:0.1:2; % sampling of the interval [0,2]
[xx,yy]=meshgrid(x,y); % matrixes of x and y coordinates
figure(1)
mesh(xx,yy,0*xx) % Draw the mesh
axis([-2,2,-1,3]) % select region for drawing
view(2) % See the picture from the top
2 To go further
Mesh of a parametrized 2-D solid
Visualization of a scalar field in a solid