Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Commit

Permalink
more figure caption fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman committed Apr 20, 2016
1 parent eef5c5b commit 3949f17
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 92 deletions.
8 changes: 4 additions & 4 deletions chapters/00_7_intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h5>Example I.1: Traditional random walk</h5>
<p>Conveniently, this is how the <span class="function">random()</span> function works. Processing&rsquo;s random number generator (which operates behind the scenes) produces what is known as a &ldquo;uniform&rdquo; distribution of numbers. We can test this distribution with a Processing sketch that counts each time a random number is picked and graphs it as the height of a rectangle.</p>

<figure class="screenshot" data-pde="processingjs/intro/_I_2_RandomDistribution/_I_2_RandomDistribution.pde"><img alt="intro ex02" src="intro/intro_ex02.png" />
<figcaption>intro ex02&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -575,7 +575,7 @@ <h2>Calculating Mean and Standard Deviation</h2>
<p>The <span class="function">nextGaussian()</span> function returns a normal distribution of random numbers with the following parameters: <em>a mean of zero</em> and <em>a standard deviation of one</em>. Let&rsquo;s say we want a mean of 320 (the center horizontal pixel in a window of width 640) and a standard deviation of 60 pixels. We can adjust the value to our parameters by multiplying it by the standard deviation and adding the mean.</p>

<figure class="screenshot" data-pde="processingjs/intro/_I_4_Gaussian/_I_4_Gaussian.pde"><img alt="intro ex04" src="intro/intro_ex04.png" />
<figcaption>intro ex04&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -881,7 +881,7 @@ <h3>Mapping Noise</h3>
<p>We can apply the exact same logic to our random walker, and assign both its x- and y-values according to Perlin noise.</p>

<figure class="screenshot" data-pde="processingjs/intro/_I_5_NoiseWalk/_I_5_NoiseWalk.pde processingjs/intro/_I_5_NoiseWalk/Walker.pde"><img alt="intro ex05" src="intro/intro_ex05.png" />
<figcaption>intro ex05&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -947,7 +947,7 @@ <h3>Two-Dimensional Noise</h3>
<p>If you were to visualize this graph paper with each value mapped to the brightness of a color, you would get something that looks like clouds. White sits next to light gray, which sits next to gray, which sits next to dark gray, which sits next to black, which sits next to dark gray, etc.</p>

<figure><img alt="intro ex06" src="intro/intro_ex06.png" />
<figcaption>intro ex06&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<p>This is why noise was originally invented. You tweak the parameters a bit or play with color to make the resulting image look more like marble or wood or any other organic texture.</p>
Expand Down
18 changes: 9 additions & 9 deletions chapters/01_vectors.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ <h2>Vector subtraction</h2>
<p>The following example demonstrates vector subtraction by taking the difference between two points&mdash;the mouse location and the center of the window.</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_3_vector_subtraction/_1_3_vector_subtraction.pde"><img alt="ch01 ex03" src="chapter01/ch01_ex03.png" />
<figcaption>ch01 ex03&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.3: Vector subtraction</h5></div>
Expand Down Expand Up @@ -595,7 +595,7 @@ <h2>Vector multiplication</h2>
u.mult(3);</pre>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_4_vector_multiplication/_1_4_vector_multiplication.pde"><img alt="ch01 ex04" src="chapter01/ch01_ex04.png" />
<figcaption>ch01 ex04&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.4: Multiplying a vector</h5></div>
Expand Down Expand Up @@ -685,7 +685,7 @@ <h2>1.5 Vector Magnitude</h2>
}</pre>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_5_vector_magnitude/_1_5_vector_magnitude.pde"><img alt="ch01 ex05" src="chapter01/ch01_ex05.png" />
<figcaption>ch01 ex05&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.5: Vector magnitude</h5></div>
Expand Down Expand Up @@ -761,7 +761,7 @@ <h2>1.6 Normalizing Vectors</h2>
}</pre>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_6_vector_normalize/_1_6_vector_normalize.pde"><img alt="ch01 ex06" src="chapter01/ch01_ex06.png" />
<figcaption>ch01 ex06&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.6: Normalizing a vector</h5></div>
Expand Down Expand Up @@ -909,7 +909,7 @@ <h2>1.7 Vector Motion: Velocity</h2>
<p>Here is the entire example for reference:</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_7_motion101/_1_7_motion101.pde processingjs/chapter01/_1_7_motion101/Mover.pde"><img alt="ch01 ex07" src="chapter01/ch01_ex07.png" />
<figcaption>ch01 ex07&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.7: Motion 101 (velocity)</h5></div>
Expand Down Expand Up @@ -1077,7 +1077,7 @@ <h5>Exercise 1.4</h5>
<p>Let&rsquo;s take a look at the changes to the <span class="klass">Mover</span> class, complete with <span class="function">acceleration</span> and <span class="function">limit()</span>.</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_8_motion101_acceleration/_1_8_motion101_acceleration.pde processingjs/chapter01/_1_8_motion101_acceleration/Mover.pde"><img alt="ch01 ex08" src="chapter01/ch01_ex08.png" />
<figcaption>ch01 ex08&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.8: Motion 101 (velocity and constant acceleration)</h5></div>
Expand Down Expand Up @@ -1124,7 +1124,7 @@ <h5>Exercise 1.5</h5>
<p>Now on to Algorithm #2, <em>a totally random acceleration</em>. In this case, instead of initializing acceleration in the object&rsquo;s constructor, we want to pick a new acceleration each cycle, i.e. each time <span class="function">update()</span> is called.</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_9_motion101_acceleration/_1_9_motion101_acceleration.pde processingjs/chapter01/_1_9_motion101_acceleration/Mover.pde"><img alt="ch01 ex09" src="chapter01/ch01_ex09.png" />
<figcaption>ch01 ex09&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.9: Motion 101 (velocity and random acceleration)</h5></div>
Expand Down Expand Up @@ -1356,7 +1356,7 @@ <h2>1.10 Interactivity with Acceleration</h2>
<p>And here are those steps in the <span class="function">update()</span> function itself:</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_10_motion101_acceleration/_1_10_motion101_acceleration.pde processingjs/chapter01/_1_10_motion101_acceleration/Mover.pde"><img alt="ch01 ex10" src="chapter01/ch01_ex10.png" />
<figcaption>ch01 ex10&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.10: Accelerating towards the mouse</h5></div>
Expand Down Expand Up @@ -1396,7 +1396,7 @@ <h5>Exercise 1.8</h5>
<p>Let&rsquo;s see what this example would look like with an array of movers (rather than just one).</p>

<figure class="screenshot" data-pde="processingjs/chapter01/_1_11_motion101_acceleration_array/_1_11_motion101_acceleration_array.pde processingjs/chapter01/_1_11_motion101_acceleration_array/Mover.pde"><img alt="ch01 ex11" src="chapter01/ch01_ex11.png" />
<figcaption>ch01 ex11&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example"><h5>Example 1.11: Array of movers accelerating towards the mouse</h5></div>
Expand Down
14 changes: 7 additions & 7 deletions chapters/02_forces.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ <h2>2.5 Creating Forces</h2>
<p>The result isn&rsquo;t terribly interesting, but it is a good place to start. We create a <span class="klass">PVector</span> object, initialize it, and pass it into an object (which in turn will apply it to its own acceleration). If we wanted to have two forces, perhaps wind and gravity (a bit stronger, pointing down), we might write the following:</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_1_forces/_2_1_forces.pde processingjs/chapter02/_2_1_forces/Mover.pde"><img alt="ch02 ex01" src="chapter02/ch02_ex01.png" />
<figcaption>ch02 ex01&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -504,7 +504,7 @@ <h5>Example 2.1: Forces</h5>
<p>Once the array of objects is declared, created, and initialized, the rest of the code is simple. We run through every object, hand them each the forces in the environment, and enjoy the show.</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_2_forces_many/_2_2_forces_many.pde processingjs/chapter02/_2_2_forces_many/Mover.pde"><img alt="ch02 ex02" src="chapter02/ch02_ex02.png" />
<figcaption>ch02 ex02&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -547,7 +547,7 @@ <h2>2.6 Gravity on Earth and Modeling a Force</h2>
<p>You may have noticed something woefully inaccurate about this last example. The smaller the circle, the faster it falls. There is a logic to this; after all, we just stated (according to Newton&rsquo;s second law) that the smaller the mass, the higher the acceleration. But this is not what happens in the real world. If you were to climb to the top of the Leaning Tower of Pisa and drop two balls of different masses, which one will hit the ground first? According to legend, Galileo performed this exact test in 1589, discovering that they fell with the same acceleration, hitting the ground at the same time. Why is this? As we will see later in this chapter, the force of gravity is calculated relative to an object&rsquo;s mass. The bigger the object, the stronger the force. So if the force is scaled according to mass, it is canceled out when acceleration is divided by mass. We can implement this in our sketch rather easily by multiplying our made-up gravity force by mass.</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_3_forces_many_realgravity/_2_3_forces_many_realgravity.pde processingjs/chapter02/_2_3_forces_many_realgravity/Mover.pde"><img alt="ch02 ex03" src="chapter02/ch02_ex03.png" />
<figcaption>ch02 ex03&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -889,7 +889,7 @@ <h2>2.8 Air and Fluid Resistance</h2>
<p>And with these two functions added to the <span class="klass">Liquid</span> class, we&rsquo;re ready to put it all together in the main tab:</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_5_fluidresistance/_2_5_fluidresistance.pde processingjs/chapter02/_2_5_fluidresistance/Liquid.pde processingjs/chapter02/_2_5_fluidresistance/Mover.pde"><img alt="ch02 ex05" src="chapter02/ch02_ex05.png" />
<figcaption>ch02 ex05&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -1235,7 +1235,7 @@ <h2>2.9 Gravitational Attraction</h2>
<p>Our <span class="klass">Mover</span> class hasn&rsquo;t changed at all, so let&rsquo;s just look at the main program and the <span class="klass">Attractor</span> class as a whole, adding a variable <span class="var">G</span> for the universal gravitational constant. (On the website, you&rsquo;ll find that this example also has code that allows you to move the <span class="klass">Attractor</span> object with the mouse.)</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_6_attraction/_2_6_attraction.pde processingjs/chapter02/_2_6_attraction/Attractor.pde processingjs/chapter02/_2_6_attraction/Mover.pde"><img alt="ch02 ex06" src="chapter02/ch02_ex06.png" />
<figcaption>ch02 ex06&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -1300,7 +1300,7 @@ <h5>Example 2.6: Attraction</h5>
<p>And we could, of course, expand this example using an array to include many <span class="klass">Mover</span> objects, just as we did with friction and drag:</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_7_attraction_many/_2_7_attraction_many.pde processingjs/chapter02/_2_7_attraction_many/Attractor.pde processingjs/chapter02/_2_7_attraction_many/Mover.pde"><img alt="ch02 ex07" src="chapter02/ch02_ex07.png" />
<figcaption>ch02 ex07&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down Expand Up @@ -1415,7 +1415,7 @@ <h2>2.10 Everything Attracts (or Repels) Everything</h2>
<p>Of course, there&rsquo;s one small problem. When we are looking at every mover <span class="var">i</span> and every mover <span class="var">j</span>, are we OK with the times that <span class="var">i</span> equals <span class="var">j</span>? For example, should mover #3 attract mover #3? The answer, of course, is no. If there are five objects, we only want mover #3 to attract 0, 1, 2, and 4, skipping itself. And so, we finish this example by adding a simple conditional statement to skip applying the force when i equals j.</p>

<figure class="screenshot" data-pde="processingjs/chapter02/_2_8_mutual_attraction/_2_8_mutual_attraction.pde processingjs/chapter02/_2_8_mutual_attraction/Mover.pde"><img alt="ch02 ex08" src="chapter02/ch02_ex08.png" />
<figcaption>ch02 ex08&nbsp;</figcaption>
<figcaption>&nbsp;</figcaption>
</figure>

<div data-type="example">
Expand Down
Loading

0 comments on commit 3949f17

Please sign in to comment.