Diferencia entre revisiones de «Dibujar un sólido 2-D»

De MateWiki
Saltar a: navegación, buscar

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/mat/public_html/w/includes/diff/DairikiDiff.php on line 434
Línea 1: Línea 1:
We show how to draw meshes of plane regions, que representarán sólidos, con Octave UPM. El objetivo es poder definir cantidades físicas en los puntos del mallado y visualizarlas después.
+
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:
Comenzamos con el ejemplo más simple. Comenzamos con el ejemplo más simple. Dibujaremos un mallado del rectángulo <math> [-1/2,1/2]\times [0,2]</math>. El proceso es el siguiente:
+
 
 +
# We introduce a sampling of the two segments with a suitable step
 +
# With meshgrid command we define two matrixes with the x and y coordenates of the mesh points
 +
# We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top. 
 +
 
 +
The Octave code is:
 +
==  MATLAB code  ==
 +
{{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 coordinatesfigure(1)mesh(xx,yy,0*xx)      % Draw the meshaxis([-2,2,-1,3])      % select region for drawingview([0,0,1])          % See the pisture from the top
 +
}}
 +
 
  
 
[[Categoría:Curso ICE]]
 
[[Categoría:Curso ICE]]

Revisión del 18:29 16 nov 2013

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:

  1. We introduce a sampling of the two segments with a suitable step
  2. With meshgrid command we define two matrixes with the x and y coordenates of the mesh points
  3. We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top.

The Octave code is:

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 coordinatesfigure(1)mesh(xx,yy,0*xx)       % Draw the meshaxis([-2,2,-1,3])      % select region for drawingview([0,0,1])          % See the pisture from the top