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

Convert uses of PVector.magnitude() to PVector.mag() #116

Merged
merged 1 commit into from Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion chapters/02_forces.html
Expand Up @@ -769,7 +769,7 @@ <h2>2.8 Air and Fluid Resistance</h2>
<p><span data-type="equation">\rho</span> is the Greek letter <em>rho</em>, and refers to the density of the liquid, something we don’t need to worry about. We can simplify the problem and consider this to have a constant value of 1.</p>
</li>
<li>
<p><span data-type="equation">v</span> refers to the speed of the object moving. OK, we’ve got this one! The object’s speed is the magnitude of the velocity vector: <code>velocity.magnitude()</code>. And <span data-type="equation">v^2</span> just means <span data-type="equation">v</span> squared or <span data-type="equation">v \times v</span>.</p>
<p><span data-type="equation">v</span> refers to the speed of the object moving. OK, we’ve got this one! The object’s speed is the magnitude of the velocity vector: <code>velocity.mag()</code>. And <span data-type="equation">v^2</span> just means <span data-type="equation">v</span> squared or <span data-type="equation">v \times v</span>.</p>
</li>
<li>
<p><span data-type="equation">A</span> refers to the frontal area of the object that is pushing through the liquid (or gas). An aerodynamic Lamborghini, for example, will experience less air resistance than a boxy Volvo. Nevertheless, for a basic simulation, we can consider our object to be spherical and ignore this element.</p>
Expand Down
2 changes: 1 addition & 1 deletion chapters/05_physicslib.html
Expand Up @@ -2331,7 +2331,7 @@ <h3>Vectors with toxiclibs</h3>
<td>
<pre>
Vec2D a = new Vec2D(1,-1);
float m = a.magnitude();
float m = a.mag();
a.normalize();
</pre>
</td>
Expand Down
Expand Up @@ -78,7 +78,7 @@ class Particle{
// if the particle is moving fast enough, when it hits the ground it can
// split into a bunch of smaller particles.
if( ISBOUNCING ){
bounceVel = vel.magnitude();
bounceVel = vel.mag();

vel.scaleSelf( .7 );
vel.y *= -( ( radius/40.0 ) * .5 );
Expand Down
Expand Up @@ -78,7 +78,7 @@ class Particle{
// if the particle is moving fast enough, when it hits the ground it can
// split into a bunch of smaller particles.
if( ISBOUNCING ){
bounceVel = vel.magnitude();
bounceVel = vel.mag();

vel.scaleSelf( .7 );
vel.y *= -( ( radius/40.0 ) * .5 );
Expand Down