Draw a system of points

De MateWiki
Saltar a: navegación, buscar
System of mass points

We show how to draw a system of points in 3D. The objective is to represent a rigid body as a system of [math] N [/math] mass particles in such a way that the relative position of the points is fixed. We start with the simplest example, the four corners in a square. We follow the steps:

  1. We introduce a vector [math]3 \times N [/math] that contains in each column the three cartesian components of each point
  2. We plot the points with plot3 command
  3. We adjunst the axis.

1 MATLAB code

1 x=[1 1 -1 -1;1 -1 -1 1;0 0 1 1];                         % coordinates of the points
2 figure(1)
3 plot3(x(1,:),x(2,:),x(3,:),'o-','MarkerFaceColor','b')   % Draw the points
4 axis([-2,2,-2,2,-2,2])                                   % select region for drawing



2 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