| 3. Define the View While all the stream lines start in the z = 5 plane, the values of some spiral down to lower values. The following settings provide a clear view of the animation: • The viewpoint (view) selected shows both the plane containing most stream lines and the spiral. • Selecting a data aspect ratio (daspect)of [2 2 0.125] provides greater resolution in the z direction to make the stream particles more easily visible in the spiral. • Set the axes limits to match the data limits (axis)anddrawtheaxisbox (box). view(-10.5,18) daspect([2 2 0.125]) axis tight; box on 4. Calculate the Stream Particle Vertices The first step is to determine the vertices along the stream line where a particle should be drawn. The interpstreamspeed function returns this data based on the stream line vertices and the speed ofthe vector data. This example scales the velocities by 0.05 to increase the number of interpolated vertices. Setting the axes DrawMode property to fast enables the animation to run faster. The streamparticles function sets the following properties: • Animate to 10 to run the animation 10 times • ParticleAlignment to on to start all particle traces together • MarkerEdgeColor to none to draw only the face ofthe circular marker. Animations usually run faster when marker edges are not drawn. • MarkerFaceColor to red • Marker to o, which draws a circular marker. You can use other line markers as well. |