<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pythagorean Theorem &#8211; BetterExplained</title>
	<atom:link href="https://betterexplained.com/topics/pythagorean-theorem/feed/" rel="self" type="application/rss+xml" />
	<link>https://betterexplained.com</link>
	<description>Math lessons that click</description>
	<lastBuildDate>Thu, 17 Sep 2026 23:28:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Pythagorean Theorem As Sweeping Area</title>
		<link>https://betterexplained.com/articles/pythagorean-sweep/</link>
					<comments>https://betterexplained.com/articles/pythagorean-sweep/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Thu, 20 Jun 2019 04:12:36 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Pythagorean Theorem]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=12213</guid>

					<description><![CDATA[The Pythagorean Theorem is often taken as a fact about right triangles . Let's try a broader interpretation: The Pythagorean Theorem explains how 2D area can be combined. Here's what I mean. Suppose we have two lines lying around (the creatively named Line A and Line B ). We can spin them to create area: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The Pythagorean Theorem is often taken as a fact about <a href="https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/">right triangles</a>.
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/theorem.png" alt="Pythagorean Theorem As Sweeping Area" class="webpexpress-processed"></p>

<p>Let's try a broader interpretation: <strong>The Pythagorean Theorem explains how 2D area can be combined.</strong></p>

<p>Here's what I mean. Suppose we have two lines lying around (the creatively named <em>Line A</em> and <em>Line B</em>). We can spin them to create area:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythag_sweep/sweep-line.png" alt="sweep-line" class="webpexpress-processed"></p>

<p>Ok, fun enough. Where's the mystery?</p>

<p>Well, what happens if we <em>combine</em> the line segments before spinning them?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythag_sweep/sweep-combined-line.png" alt="sweep-combined-line" class="webpexpress-processed"></p>

<p>Whoa. The area swept out seems to change. Should simply <em>moving</em> the lines, not lengthening them, change the area?</p>

<h2>Running The Numbers</h2>

<p>Eyeballing the diagram above, it sure seems like the area grew. Let's work out the specifics.</p>

<p>As an example, suppose <img src="https://betterexplained.com/latex/eb676a69d16761e7a9ac.png" alt="$a = 6$" width="43" height="14" style="vertical-align:-1.49px" class="bex-math"></img> and <img src="https://betterexplained.com/latex/1f0504e34d7ecd4ae90c.png" alt="$b = 8$" width="41" height="15" style="vertical-align:-1.49px" class="bex-math"></img>. When they're swept into circles (<img src="https://betterexplained.com/latex/c3bb9ff625ee09fb6c35.png" alt="$\text{area} = \pi r^2$" width="84" height="17" style="vertical-align:-1.49px" class="bex-math"></img>) we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/bf3d2eaaf7e6e95b903d1905847bf114.png' width='237' height='21' alt='\displaystyle{\text{Circle A} = \pi a^2 = \pi (6^2) = 36 \pi}' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a78ceaacf3dbeadeb2fc34d44c999a38.png' width='235' height='21' alt='\displaystyle{\text{Circle B} = \pi b^2 = \pi (8^2) = 64 \pi  }' class='tex'></p>

<p>For a total of <img src="https://betterexplained.com/latex/63e1add49ce3b1226235.png" alt="$36\pi + 64\pi = 100\pi$" width="141" height="14" style="vertical-align:-1.49px" class="bex-math"></img>.</p>

<p>The combined segment has length <img src="https://betterexplained.com/latex/1b466f3e1d15ea93dc82.png" alt="$c = a + b = 14$" width="114" height="15" style="vertical-align:-1.49px" class="bex-math"></img>, and when we spin it we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/3642987361e0da9ee00af6d4b055b45a.png' width='253' height='21' alt='\displaystyle{\text{Circle C} = \pi c^2 = \pi (14^2) = 196 \pi }' class='tex'></p>

<p>Uh oh. That's way more area than before.</p>

<h2>The Problem</h2>

<p>What happened? Well, Circle A didn't change. But Circle B is much less than Ring B (just look at it!).</p>

<p>The issue: When Line B spins on its own, it can only reach 8 units out as it sweeps. When we attach Line B to Line A, it reaches out 6 + 8 = 14 units. Now the circular sweep covers more area, meaning Circle B is smaller than Ring B.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythag_sweep/sweep-when-parallel.png" alt="sweep-when-parallel" class="webpexpress-processed"></p>

<p>Mathematically, here's what happened.</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/570b9a017be116fe0c695ad715899195.png' width='365' height='46' alt='\displaystyle{\underbrace{[a + b]^2}_{\text{Circle C}} = \underbrace{a^2}_{\text{Circle A}} + \underbrace{2ab + b^2}_{\text{Ring B}} &gt; \underbrace{a^2}_{\text{Circle A}} + \underbrace{b^2}_{\text{Circle B}}}' class='tex'></p>

<p>Ignore <img src="https://betterexplained.com/latex/6cbee51e8365518a121a.png" alt="$\pi$" width="11" height="8" style="vertical-align:-0.2px" class="bex-math"></img> for a moment since it's a common term. When expanding <img src="https://betterexplained.com/latex/e28b46989df7ce09156b.png" alt="$c^2 = (a + b)^2 = a^2 + 2ab + b^2$" width="230" height="20" style="vertical-align:-4.53px" class="bex-math"></img>, there's a new <img src="https://betterexplained.com/latex/790182472c6e1287b5dd.png" alt="$2ab$" width="27" height="13" style="vertical-align:-0.2px" class="bex-math"></img> term that has to go somewhere. Because Circle A doesn't change, this extra area must appear in Ring B.</p>

<h2>Making Things Line Up</h2>

<p>It... sort of makes sense that the area changes, but I don't like it. Just moving things around shouldn't have this effect! Can the area ever be the same?</p>

<p>Sure, if we remove the <img src="https://betterexplained.com/latex/790182472c6e1287b5dd.png" alt="$2ab$" width="27" height="13" style="vertical-align:-0.2px" class="bex-math"></img> term. The easy fix is to set <img src="https://betterexplained.com/latex/4f8831ca6ca778d12426.png" alt="$a=0$" width="43" height="14" style="vertical-align:-1.49px" class="bex-math"></img>, but that's cheating and you know it.</p>

<p>Let's find a clever solution. Intuitively, the question is: <strong>How can Line A's length <em>not</em> help Line B as it spins?</strong></p>

<p>Tilt it! As we rotate Line B, there's less benefit from Line A's length. Ladders are useless when lying on the floor, right?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythag_sweep/area-sweep-parallel-perp.png" alt="sweep-when-parallel" class="webpexpress-processed"></p>

<p>When we go Full Perpendicular&#x2122;, the <img src="https://betterexplained.com/latex/790182472c6e1287b5dd.png" alt="$2ab$" width="27" height="13" style="vertical-align:-0.2px" class="bex-math"></img> term disappears and Circle B = Ring B. (In vector terms, the <a href="https://betterexplained.com/articles/vector-calculus-understanding-the-dot-product/">dot product</a> is zero: <img src="https://betterexplained.com/latex/c4a35a6aa6b473a042f6.png" alt="$a \cdot b = 0$" width="64" height="15" style="vertical-align:-1.49px" class="bex-math"></img>).</p>

<p>Ah -- that's the meaning of the Pythagorean Theorem. <strong>When line segments are perpendicular, the same area is swept whether the lines are combined or separated.</strong></p>

<h2>Checking The Math</h2>

<p>It's not a bad idea to make sure the numbers line up.</p>

<p>Since the segments are now perpendicular, we know <img src="https://betterexplained.com/latex/f71ec3abdf3071a8b143.png" alt="$c^2 = a^2 + b^2$" width="96" height="17" style="vertical-align:-1.49px" class="bex-math"></img>, so:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/0646671b280c921e272f483334bbd19a.png' width='232' height='22' alt='\displaystyle{\text{Full distance} = c = \sqrt{a^2 + b^2}}' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/d7b56ff1c59b39857c0708a42627e307.png' width='298' height='23' alt='\displaystyle{\text{Width of ring} = \text{c - a} = \sqrt{a^2 + b^2} - a}' class='tex'></p>

<p>Now we can calculate:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/e9733c16ef55ee379c8da2a43f5775fe.png' width='632' height='21' alt='\displaystyle{\text{Ring B} = \text{Circle C} - \text{Circle A} = \pi c^2 - \pi a^2 = \pi (a^2 + b^2) - \pi a^2 = \pi b^2 = \text{Circle B}}' class='tex'></p>

<p>Tada! The Ring and Circle sweep the same area.</p>

<iframe src="https://instacalc.com/52831/embed" width="450" height="250" frameborder="0"></iframe>

<p>In our example, we have Circle A = <img src="https://betterexplained.com/latex/e177d6169ed55fb871ad.png" alt="$36\pi$" width="29" height="13" style="vertical-align:-0.4px" class="bex-math"></img>, Circle B = <img src="https://betterexplained.com/latex/646c03b26b99f5600426.png" alt="$64 \pi$" width="29" height="13" style="vertical-align:-0.4px" class="bex-math"></img>, <img src="https://betterexplained.com/latex/b25ca06b55f3a3d7231e.png" alt="$c = \sqrt{36 + 64} = 10$" width="148" height="20" style="vertical-align:-2.44px" class="bex-math"></img>. The ring width is <img src="https://betterexplained.com/latex/9dc323b196730f79f6d1.png" alt="$10 - 6 = 4$" width="83" height="14" style="vertical-align:-1.49px" class="bex-math"></img>.</p>

<h2>Summary</h2>

<p>The Pythagorean Theorem is about more than triangles. When components are perpendicular, the area they make is independent of how they are arranged.</p>

<p><img decoding="async" src="https://betterexplained.com/ColorizedMath/img/Pythagorean_Theorem.png" alt="Pythagorean Theorem As Sweeping Area" /></p>

<h2>Appendix: Assorted Thoughts</h2>

<ul>
<li>The <a href="https://betterexplained.com/articles/law-of-cosines/">Law of Cosines</a> explicitly shows the <img src="https://betterexplained.com/latex/790182472c6e1287b5dd.png" alt="$2ab$" width="27" height="13" style="vertical-align:-0.2px" class="bex-math"></img> term which assumed to be zero in the Pythagorean Theorem. The area of Ring B can even be "negative" if we tilt Line B to point inside.</li>
<li>We can combine area from <a href="https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/">multiple dimensions</a> (<img src="https://betterexplained.com/latex/0c909ad115f890221c3a.png" alt="$x^2 + y^2 + z^2 + ...$" width="131" height="19" style="vertical-align:-3.71px" class="bex-math"></img>). As long as they are mutually perpendicular, the area swept by each dimension is the area swept by the total.</li>
<li>The Pythagorean Theorem is a relationship in the 2D area domain (<img src="https://betterexplained.com/latex/f71ec3abdf3071a8b143.png" alt="$c^2 = a^2 + b^2$" width="96" height="17" style="vertical-align:-1.49px" class="bex-math"></img>). We start here and convert this to a relationship in the 1D domain (<img src="https://betterexplained.com/latex/268ba810d1c32212bcd7.png" alt="$c = \sqrt{a^2 + b^2}$" width="103" height="20" style="vertical-align:-1.7px" class="bex-math"></img>). The conversion happens so often we forget where it began.</li>
<li>More on sweeping area: <a href="https://www.cut-the-knot.org/Curriculum/Geometry/PythFromRing.shtml">https://www.cut-the-knot.org/Curriculum/Geometry/PythFromRing.shtml</a></li>
</ul>

<p>Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/pythagorean-sweep/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		

			</item>
	<item>
		<title>Understanding Pythagorean Distance and the Gradient</title>
		<link>https://betterexplained.com/articles/understanding-pythagorean-distance-and-the-gradient/</link>
					<comments>https://betterexplained.com/articles/understanding-pythagorean-distance-and-the-gradient/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Fri, 04 Nov 2011 16:24:48 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Vector Calculus]]></category>
				<category><![CDATA[Pythagorean Theorem]]></category>
		<guid isPermaLink="false">http://betterexplained.com/?p=1460</guid>

					<description><![CDATA[The Pythagorean Theorem shows how strange our concept of distance is. Using the rule , we can trade some "a" to get more "b". Starting with means "A 13-inch pizza equals a 13-inch pizza". Sure. But we can trade an inch and get: Huh? A 12-inch pizza and a 5-inch pizza equal a 13-inch pizza? [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The <a href="https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/">Pythagorean Theorem</a> shows how strange our concept of distance is. Using the rule <img src="https://betterexplained.com/latex/34b5a306bb294561834a.png" alt="$a^2 + b^2 = c^2$" width="96" height="17" style="vertical-align:-1.49px" class="bex-math"></img>, we can trade some "a" to get more "b".</p>

<p>Starting with</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/4fe780744f65a3a106be7088db2d4cc4.png' width='113' height='18' alt='\displaystyle{13^2 + 0^2 = 13^2}' class='tex'></p>

<p>means "A 13-inch pizza equals a 13-inch pizza". Sure. But we can trade an inch and get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/87c51dc809eaac5cee3f2bd3954af2fa.png' width='113' height='18' alt='\displaystyle{12^2 + 5^2 = 13^2}' class='tex'></p>

<p>Huh? A 12-inch pizza and a 5-inch pizza equal a 13-inch pizza?</p>

<p>The math works (144 + 25 = 169) but, but... we gave up an inch and got a five-inch pizza!</p>

<p>Let's understand why the tradeoff happens, and how to use it.</p>

<h2>Explanation 1: Shaving the Square</h2>

<p>A key insight: <strong>Bigger numbers are harder to square</strong>.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagdistance/shavingthesquare.png" alt="Shaving the Square" /></p>

<p>Imagine laying tiles on a porch -- as your porch grows, the outer layer needs more tiles. Trimming a 13x13 porch to 12x12 frees up 25 tiles, which is enough to make a new 5x5 porch!</p>

<p>I call this "shaving the square". Trimming 1 unit from the outside of a large square has more "shavings" which can contribute to a smaller one (trimming an inch from a giant fro can make a sweater for an infant). As we continue to trim, the benefit diminishes because our starting point is smaller and smaller.</p>

<h2>Explanation 2: Sliding the Chopstick</h2>

<p>A second insight: <strong>Slide a little, pivot a lot</strong>.</p>

<p>Imagine a chopstick wedged in a corner: the length is fixed, and the ends of the chopstick must touch a wall. What're the options?</p>

<p>Well, laying on a single wall means 100% for one side (like saying <img src="https://betterexplained.com/latex/fd2513ad9167debf53e8.png" alt="$13^2 + 0^2 = 13^2$" width="116" height="18" style="vertical-align:-1.49px" class="bex-math"></img>). Not that interesting.</p>

<p>By sliding the chopstick (from 13 to 12) we can swing it <em>out</em> by 5 on the other wall!</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagdistance/slideandpivot.png" alt="pythagorean theorem slide sides" class="webpexpress-processed"></p>

<p>You need to try it -- a small slide gives a giant pivot. As we keep sliding, the tradeoff (How much pivot do we get?) changes.</p>

<h2>So What's the Tradeoff?</h2>

<p>Time to see how the a/b tradeoff works. First, let's use grid coordinates: x &amp; y (horizontal and vertical). Given a fixed distance (13 units, let's say), our options lay on the circle where <img src="https://betterexplained.com/latex/98713b46946f775e532f.png" alt="$x^2 + y^2 = 13^2$" width="108" height="20" style="vertical-align:-3.71px" class="bex-math"></img>:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagdistance/xytrade.png" alt="pythagorean theorem X-Y tradeoff" class="webpexpress-processed"></p>

<p>A few points:</p>

<ul>
<li>Each possibility is the same distance, but has a different ratio of x to y (100% x, 100% y, or a mix like (12,5))</li>
<li>We can only move to neighboring points on the circle (options at the same distance)</li>
<li>The tradeoff we face is how much "x" we get for "y" when moving to a neighbor. If we're at (0, 13) we could move to (5, 12). This trades 1 y for 5 x's.</li>
</ul>

<p>This is the "chunky" tradeoff where we're using an entire unit at a time. What about .5 units? .01?</p>

<p>Enter the tangent! The <strong>tangent line</strong> shows the trajectory of our current path, the direction to our neighbor. We follow the tangent for a tiny, microscopic amount to get our next neighbor. The tangent is an approximation -- it's not pointing exactly at our nearest neighbor, but it's pretty close.</p>

<p><strong>The tangent shows the tradeoff you are about to make.</strong></p>

<p>What's the actual amount? Any point (x,y) has a slope of y/x, and a tangent line with slope -x/y, so the tradeoff is...getting confused yet?</p>

<p>Less mindless algebra, more intuition:</p>

<ul>
<li>Circles have a tangent line perpendicular to the current point</li>
<li>If you're at (5,12) then tangent slope is some ratio of 5 and 12</li>
<li>Remember "shaving the square": you get a better deal in the direction of the smaller coordinate (increasing a large square is tough).</li>
<li>So, at (5, 12) you're "heavy on the y" and the trade will favor improving your x: it should be "trade 5 y's for 12 x's". And why not the other way? It doesn't make sense that the more y you have, the <em>easier</em> it is to get y! That'd spiral off into exponential growth, not a circle.</li>
<li>Lastly, we can't trade an entire chunk of 5 y's! The tangent is about our nearest neighbor. We have a trade of 12/5 or 2.4 to 1. Our next, tiny movement will be at this ratio (and then we'll be at a new point, with a new tangent).</li>
</ul>

<p>General principle: Our neighbors are on a circle, which encourages balance. You get a better deal in the direction of the smaller coordinate: at (x,y) the tradeoff is y:x.</p>

<h2>Optimizing The Tradeoff</h2>

<p>Now we know the tradeoff for any point (x,y) -- let's optimize!</p>

<p>In a boring scenario, we get paid based on pure distance, so every point (or direction to move) is the same.</p>

<p>The exciting scenario: our (x,y) position is an <em>input</em> into some other function which gives us a return! Now we want to maximize that function.</p>

<p>Here's a scenario: Popeye throws cars for cash. He lines up spectators on fences running North and East. The spectators must look straight ahead (they're in neck braces, due to earlier events) but will pay Popeye if they see a car pass in front of them.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagdistance/popeyeshow.png" alt="Popeye's show" /></p>

<h2>Maximizing Even Payouts</h2>

<p>Suppose each spectator offers \$1 if they see the car (Payout (x,y) = x + y). Where to throw?</p>

<p>First, assume Popeye has finite energy -- he can throw the car 13 meters. Now let's start somewhere: throwing the car pure North (0, 13):</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/be9333c28d7332adf440274cc021c15e.png' width='179' height='19' alt='\displaystyle{P(0,13) = 0 + 13 = 13}' class='tex'></p>

<p>Ok. What if he threw it slightly East? To (5, 12) let's say?</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/fbd3f9d7b6aed2e5e6d689a47532fc54.png' width='179' height='19' alt='\displaystyle{P(5,12) = 5 + 12 = 17}' class='tex'></p>

<p>Clearly better. This should make sense: at (0,13) the tradeoff is <em>great</em> to get more East. We can give up 1 North and get a whopping 5 East, a "profit" of \$4 if we do the trade. We should keep trading as long as it's profitable -- as long as we're out of balance, the circle will reward us for boosting the smaller side. Following a 45 degree angle for 13 units is the ideal:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/d0aa29750260bd8cccd756ea1c63d2fd.png' width='492' height='42' alt='\displaystyle{P(13 \cdot \frac{1}{\sqrt{2}}, 13 \cdot \frac{1}{\sqrt{2}}) = P(13 \cdot .707, 13 \cdot .707) = 9.2 + 9.2 = 18.4}' class='tex'></p>

<p>Neat. A 45-degree throw hits 70.7% of the possible spectators for each side.</p>

<p>Psst. Confused about how a 45-degree through passes by 70.7% of the spectators on each side? No problem.</p>

<p>A 45-degree throw is along the diagonal of a square. A triangle with sides 1 and 1 has a hypotenuse of:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/3d35623cc16766ee742fef47d09744c4.png' width='187' height='22' alt='\displaystyle{\sqrt{1^2 + 1^2} = \sqrt{2} = 1.414}' class='tex'></p>

<p>And has sides <img src="https://betterexplained.com/latex/ae17fb9374982f46a51e.png" alt="$(1, 1, 1.414)$" width="90" height="19" style="vertical-align:-4.53px" class="bex-math"></img>.</p>

<p>A hypotenuse of <img src="https://betterexplained.com/latex/b856616e3546d4d93a46.png" alt="$\sqrt{2}$" width="25" height="20" style="vertical-align:-1.8px" class="bex-math"></img> isn't convenient: it's hard to know what fraction a side is of the whole. We divide the triangle by the length of the hypotenuse (<img src="https://betterexplained.com/latex/b856616e3546d4d93a46.png" alt="$\sqrt{2}$" width="25" height="20" style="vertical-align:-1.8px" class="bex-math"></img>), making the hypotenuse 1 and the other sides a percentage:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/5a84b2056a3d701e3a5a08023044262f.png' width='415' height='45' alt='\displaystyle{\text{Triangle with sides} = (\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}, \frac{\sqrt{2}}{\sqrt{2}}) = (.707, .707, 1)}' class='tex'></p>

<p>Now we've discovered that a 45-degree throw, with sides <img src="https://betterexplained.com/latex/f7c97e2949b83b3d1a7c.png" alt="$(1, 1, \sqrt{2})$" width="73" height="22" style="vertical-align:-4.53px" class="bex-math"></img>, has the ratio <img src="https://betterexplained.com/latex/9cf5a7ef2d78e3039973.png" alt="$.707, .707, 1$" width="90" height="16" style="vertical-align:-3.51px" class="bex-math"></img>. 70.7% of the distance along the hypotenuse shows up on each side.</p>

<h2>General Technique: Finding the Best Direction</h2>

<p>We stumbled upon the way to find the best return:</p>

<ul>
<li>Pick any starting point / direction</li>
<li>Tweak it: if our return improves, keep the new choice (it's profitable)</li>
<li>Keep tweaking until our return is no longer profitable</li>
</ul>

<p>In math slang, this is "finding the local maximum". In economics slang, it's finding the point of "zero marginal returns". Popeye calls it Squeezing the Spinach.</p>

<h2>Maximizing Uneven Returns</h2>

<p>Now suppose the Northern spectators offer \$2 (Eastern stay at \$1), so P(x,y) = x + 2*y. Should we throw it 100% North?</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/cc0d3491c564298422664b79683bfd1a.png' width='201' height='19' alt='\displaystyle{ P(0, 13) = 0 + 2 \cdot 13 = 26 }' class='tex'></p>

<p>Not bad. But what about 45 degrees again?</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/9df17e3c0aac0a9df7805ed034aa21b3.png' width='253' height='19' alt='\displaystyle{P(9.2, 9.2) = 9.2 + 2 \cdot 9.2 = 27.6 }' class='tex'></p>

<p>Interesting -- 45 degrees is still better! But... I think we went too far! Shouldn't we favor North since it pays more?</p>

<p>Yep. Let's remember how to Squeeze the Spinach (maximize our returns): start with North and change until it's not profitable:</p>

<ul>
<li>The payout function means 1 North = 2 Easts (North pays \$2, so 1 unit North = 2 units East)</li>
<li>Trades are profitable if we can beat 1 North for 2 Easts (1 North for 3 Easts, for example, would profit \$1)</li>
</ul>

<p>So... where are trades <em>better</em> than 1 North for 2 Easts? In the Northern section, where the circle rewards us by throwing Easts at us ("Please, please go East... I'll give you a bunch if you give up a little North").</p>

<p>Remember how circles are about x/y, x &amp; y, x:y, etc.? Well, we have the numbers 1 and 2. (2,1) is in the East section. We want (1,2). Why? At (1,2) we have reached the perfect 1 North = 2 East tradeoff.</p>

<p>Following the direction (1,2) for 13 units is:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/d681c8ca2885425258491c7b7d7f942f.png' width='497' height='42' alt='\displaystyle{P(13 \cdot \frac{1}{\sqrt{5}}, 13 \cdot \frac{2}{\sqrt{5}}) = P(5.81, 11.62) = 5.81 + 2 \cdot 11.62 = 29.05 }' class='tex'></p>

<p>Tada! Over 29 smackeroos because we maximized our return.</p>

<h2>The Gradient Principle</h2>

<p>We can supercharge this result:</p>

<p><strong>To maximize return, go in each direction proportional to its payoff.</strong></p>

<p>If North pays 2:1 compared to East, your trajectory should favor North by 2:1. In mathier terms:</p>

<ul>
<li>Payoff(x,y) = a<em>x + b</em>y</li>
<li>Best trajectory = (a, b)  [in our case, (East, North) => (1, 2)]</li>
</ul>

<p>And this works in multiple dimensions! Given 3 dimensions, go in a direction (Payoff(x), Payoff(y), Payoff(z)). Vector calculus fans, this is why the <a href="https://betterexplained.com/articles/vector-calculus-understanding-the-gradient/">gradient</a> is in the direction of greatest increase.</p>

<p>The gradient for <img src="https://betterexplained.com/latex/690477a4a54147b8ca11.png" alt="$F(x,y,z)$" width="72" height="19" style="vertical-align:-4.53px" class="bex-math"></img> is</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/13c8856e02bc4cf4cea67c6916bf34f9.png' width='110' height='41' alt='\displaystyle{(\frac{dF}{dx},\frac{dF}{dy},\frac{dF}{dz})}' class='tex'></p>

<p>And each partial derivative (dF/dx) is the payoff for moving in that direction.</p>

<p>But does it all balance? Suppose x pays 3, y pays 4, and z pays 5 (at the current position). The 2-dimensional tradeoff trajectories are:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/2b214d4d423707d97da9b5c7dcdd34dd.png' width='103' height='18' alt='\displaystyle{ (x, y) = (3,4) }' class='tex'>
<img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a4ca4bb583d2542ab0eeb05f2faba973.png' width='102' height='18' alt='\displaystyle{ (y, z) = (4, 5) }' class='tex'>
<img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/43a3f96057809346b877f071453c6e82.png' width='103' height='18' alt='\displaystyle{ (x, z) = (3, 5) }' class='tex'></p>

<p>Now for the magic: the combined trajectory</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/e171550b05778387a538d7d3be4bc823.png' width='138' height='18' alt='\displaystyle{(x,y,z) = (3,4,5)}' class='tex'></p>

<p>satisfies all 3 requirements! On the x-z plane, x doesn't care about y -- as long as the ratio to z is (3 , ?, 5) you're getting the best tradeoff from the x-z perspective. The pairs are:</p>

<ul>
<li>(3, ?, 5)</li>
<li>(?, 4, 5)</li>
<li>(3, 4, ?)</li>
</ul>

<p>You don't need a sudoku master to see (3, 4, 5) satisfies all those proportions.</p>

<p>Still not convinced? Imagine the payoff for y was zero. We don't want to waste energy in our trajectory (3, ?, 5) in a useless direction. But that can't happen, because the y-z tradeoff will be (?, 0, 5) and the x-y tradeoff will be (3, 0, ?). The x-z tradeoff lets y-z and x-y "figure out" what y should be, which is 0.</p>

<h2>Questions I Had That You Might Have Too</h2>

<p><strong>Q: I still don't get why this works at all. Somehow 50% in x and 50% in y leads to .7 + .7 = 1.4?</strong></p>

<p>It's a deep question about <em>why</em> space behaves like this. I was going crazy staring at chopsticks on a wall.</p>

<p>Here's my answer: distance is distance. 13 units is 13 units. But in some situations we are "measuring our coordinates" (what are the values of x &amp; y) and <em>not</em> the distance itself.</p>

<p>Cartesian coordinates (x-axis, y-axis) are very inefficient for diagonal motion (i.e., you are measuring the sides of the triangle, not the hypotenuse). When <img src="https://betterexplained.com/latex/ad1ec526b87aeaceff9c.png" alt="$.707^2 + .707^2 = 1$" width="136" height="18" style="vertical-align:-1.49px" class="bex-math"></img>, it's a measure of how "inefficient" our x &amp; y coordinates are being. We used 70% of each coordinate to represent an object that could have been 100% on one (i.e, if we used polar coordinates).</p>

<p><strong>Q: I have an offshore investment with 200% return, and an onshore one with 5% return. I have \$1000 to spend -- should I split my money?</strong></p>

<p>Heavens, no! Remember, this principle is about <em>distance measurements on a grid</em> with the idea that 50% in x and 50% in y covers "more ground" than 100% in x. In investing 1) money is not on a grid and 2) there's no distance bonus. Putting half your money in each is plain old 0.5 + 0.5 = 1.0. Giving up \$1 of the offshore investment gives you \$1 for the onshore one.</p>

<p>Put all your money in the best investment.</p>

<p><strong>Q: So all this stuff is useless?</strong></p>

<p>Heavens, no! Ask yourself: am I measuring distance on a coordinate system?</p>

<p>Many things are measured in terms of x-y coordinates (physical phenomena, etc.) and <em>do</em> have the Pythagorean distance tradeoff.</p>

<p><a href="https://betterexplained.com/articles/types-of-graphs/">But not every graph is the same</a>. Graphs that aren't about distance (like "Money vs. Time") do <em>not</em> get any boost from the Pythagorean theorem. This confused me for a long time: the Pythagorean Theorem works for coordinate distance!</p>

<h2>Final Thoughts</h2>

<p>The Pythagorean Theorem is so versatile -- it's not about triangles, it covers the nature of distance. I seem to find some new realization when I study it. Really grokking it will help you everywhere, from geometry to vector calculus.</p>

<p>Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/understanding-pythagorean-distance-and-the-gradient/feed/</wfw:commentRss>
			<slash:comments>30</slash:comments>
		

			</item>
	<item>
		<title>How To Measure Any Distance With The Pythagorean Theorem</title>
		<link>https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/</link>
					<comments>https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Mon, 05 Nov 2007 08:23:13 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Pythagorean Theorem]]></category>
		<guid isPermaLink="false">http://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/</guid>

					<description><![CDATA[We’ve underestimated the Pythagorean theorem all along. It’s not about triangles; it can apply to any shape . It’s not about a, b and c; it applies to any formula with a squared term. It’s not about distance in the sense of walking diagonally across a room. It’s about any distance , like the “distance” [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>We’ve underestimated the Pythagorean theorem all along. It’s not about triangles; <a href="https://betterexplained.com/articles/surprising-uses-of-the-pythagorean-theorem/">it can apply to any shape</a>. It’s not about a, b and c; it applies to <strong>any formula</strong> with a squared term.</p>

<p>It’s not about <strong>distance</strong> in the sense of walking diagonally across a room. It’s about <strong>any distance</strong>, like the “distance” between our movie preferences or colors.</p>

<p>If it can be measured, it can be compared with the Pythagorean Theorem. Let’s see why.</p>

<h2>Understanding The Theorem</h2>

<p>We agree the theorem works. In any right triangle:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/theorem.png" alt="pythagorean theorem" class="webpexpress-processed"></p>

<p>If a=3 and b=4, then c=5&#46; Easy, right?</p>

<p>Well, a <strong>key observation</strong> is that a and b are at right angles (notice the little red box). Movement in one direction has <strong>no impact</strong> on the other.</p>

<p>It’s a bit like North/South vs. East/West. Moving North does not change your East/West direction, and vice-versa — the directions are independent (the geek term is <strong>orthogonal</strong>).</p>

<p>The Pythagorean Theorem lets you use find the <strong>shortest path distance</strong> between orthogonal directions. So it’s not really about right <strong>triangles</strong> — it’s about comparing “things” moving at right angles.</p>

<blockquote>

<p>You: <em>If I walk 3 blocks East and 4 blocks North, how far am I from my starting point?</em></p>

<p>Me: <em>5 blocks, as the crow flies. Be sure to bring adequate provisions for your journey.</em></p>

<p>You: <em>Uh, ok.</em></p>
</blockquote>

<h2>So what is “c”?</h2>

<p>Well, we could think of c as just a number, but that keeps us in boring triangle-land. I like to think of c as a <strong>combination of a and b</strong>.</p>

<p>But it’s not a simple combination like addition — after all, c doesn’t equal a + b. It’s more a combination of components — the Pythagorean theorem lets us combine <strong>orthogonal components</strong> in a manner similar to addition. And there’s the magic.</p>

<p>In our example, C is 5 blocks of “distance”. But it’s more than that: it contains a <strong>combination</strong> of 3 blocks East and 4 blocks North. Moving along C means you go East and North at the same time. Neat way to think about it, eh?</p>

<h2>Chaining the Theorem</h2>

<p>Let’s get crazy and chain the theorem together. Take a look at this:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/chainedtheorem.png" alt="chained pythagorean theorem" class="webpexpress-processed"></p>

<p>Cool, eh? We draw <strong>another</strong> triangle in red, using c as one of the sides. Since c and d are at right angles (orthogonal!), we get the Pythagorean relation: c<sup>2</sup> + d<sup>2</sup> = e<sup>2</sup>.</p>

<p>And when we replace c<sup>2</sup> with a<sup>2</sup> + b<sup>2</sup> we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/731fcc3b4fdc8e20ea821d1bb3f2971f.png' width='134' height='18' alt='\displaystyle{a^2 + b^2 + d^2 = e^2}' class='tex'></p>

<p>And that’s something: We’ve written e in terms of 3 orthogonal components (a, b and d). Starting to see a pattern?</p>

<h2>Put on your 3D Goggles</h2>

<p>Think two triangles are strange? Try pulling one out of the paper. Instead of lining the triangles flat, tilt the red one up:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/3dtheorem.png" alt="3d pythagorean theorem" class="webpexpress-processed"></p>

<p>It’s the same triangle, just facing a different way. But now we’re in 3d! If we call the sides x, y and z instead of a, b and d we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ecf516d30609bddc04f71e9580019d61.png' width='192' height='21' alt='\displaystyle{x^2 + y^2 + z^2 = \text{distance}^2}' class='tex'></p>

<p>Very nice. In math we typically measure the x-coordinate [left/right distance], the y-coordinate [front-back distance], and the z-coordinate [up/down distance]. And now we can find the 3-d distance to a point given its coordinates!</p>

<h2>Use Any Number of Dimensions</h2>

<p>As you can guess, the Pythagorean Theorem generalizes to <strong>any number of dimensions</strong>. That is, you can chain a bunch of triangles together and tally up the “outside” sections:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/multichain.png" alt="pythagorean theorem multiple dimensions" class="webpexpress-processed"></p>

<p>You can imagine that each triangle is in its own dimension. If segments are at right angles, the theorem holds and the math works out.</p>

<h2>How Distance Is Computed</h2>

<p>The Pythagorean Theorem is the basis for computing distance between two points. Consider two triangles:</p>

<ul>
<li>Triangle with sides (4,3) [blue]</li>
<li>Triangle with sides (8,5) [pink]</li>
</ul>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/distance.png" alt="distance example" class="webpexpress-processed"></p>

<p>What’s the distance from the tip of the blue triangle [at coordinates (4,3)] to the tip of the red triangle [at coordinates (8,5)]? Well, we can create a <strong>virtual triangle</strong> between the endpoints by subtracting corresponding sides. The hypotenuse of the virtual triangle is the distance between points:</p>

<ul>
<li>Distance: <img src="https://betterexplained.com/latex/5cb846a2aa22e0333b51.png" alt="$(8-4, 5-3) = (4,2) = \sqrt{4^2 + 2^2} = \sqrt{20} = 4.47$" width="377" height="23" style="vertical-align:-4.53px" class="bex-math"></img></li>
</ul>

<p>Cool, eh? In 3D, we can find the distance between points <img src="https://betterexplained.com/latex/7a4cbae84b67858b401b.png" alt="$(x_1,y_1,z_1)$" width="82" height="19" style="vertical-align:-4.53px" class="bex-math"></img> and <img src="https://betterexplained.com/latex/baa2e63d89f967d06310.png" alt="$(x_2,y_2,z_2)$" width="82" height="19" style="vertical-align:-4.53px" class="bex-math"></img> using the same approach:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/09c3ae86ba4a2367584a0404ea608d60.png' width='375' height='21' alt='\displaystyle{\text{distance}^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}' class='tex'></p>

<p>And it doesn’t matter if one side is bigger than the other, since the difference is squared and will be positive (another great side-effect of the theorem).</p>

<h2>How to Use Any Distance</h2>

<p>The theorem isn’t limited to our narrow, spatial definition of distance. It can apply to <strong>any orthogonal dimensions</strong>: space, time, movie tastes, colors, temperatures. In fact, it can apply to any set of numbers (a,b,c,d,e). Let’s take a look.</p>

<h2>Measuring User Preferences</h2>

<p>Let’s say you do a survey to find movie preferences:</p>

<ol>
<li>How did you like Rambo? (1-10)</li>
<li>How did you like Bambi? (1-10)</li>
<li>How did you like Seinfeld? (1-10)</li>
</ol>

<p>How do we compare people’s ratings? Find similar preferences? Pythagoras to the rescue!</p>

<p>If we represent ratings as a "point" (Rambo, Bambi, Seinfeld) we can represent our survey responses like this:</p>

<ul>
<li>Tough Guy: (10, 1, 3)</li>
<li>Average Joe: (5, 5, 5)</li>
<li>Sensitive Guy: (1, 10, 7)</li>
</ul>

<p>And using the theorem, we can see how different people are:</p>

<ul>
<li>Tough Guy to Average Joe: <img src="https://betterexplained.com/latex/49ecbc58891fb1121a1f.png" alt="$(10 – 5, 1 – 5, 3 – 5) = (5, -4, -2) = \sqrt{(5)^2 + (-4)^2 + (-2)^2} = \sqrt{45} = 6.7$" width="544" height="23" style="vertical-align:-5.02px" class="bex-math"></img></li>
<li>Tough Guy to Sensitive Guy: <img src="https://betterexplained.com/latex/faee293b5473992c4850.png" alt="$(10 – 1, 1 – 10, 3 – 7) = (9, -9, -4) = \sqrt{(9)^2 + (-9)^2 + (-4)^2} = \sqrt{178} = 13.34$" width="580" height="23" style="vertical-align:-5.02px" class="bex-math"></img></li>
</ul>

<p>We can compute the results using a<sup>2</sup> + b<sup>2</sup> + c<sup>2</sup> = distance<sup>2</sup> version of the theorem. As we suspected, there’s a large gap between the Tough and Sensitive Guy, with Average Joe in the middle. The theorem helps us <strong>quantify this distance</strong> and do interesting things like <strong>cluster similar results</strong>.</p>

<p>This technique can be used to rate <a href="http://www.netflixprize.com/">Netflix movie preferences</a> and other types of <strong>collaborative filtering</strong> where you attempt to make predictions based on preferences (i.e. Amazon recommendations). In geek speak, we represented preferences as a vector, and use the theorem to find the distance between them (and group similar items, perhaps).</p>

<h2>Finding Color Distance</h2>

<p>Measuring “distance” between colors is another useful application. Colors are represented as red/green/blue (RGB) values from 0(min) to 255 (max). For example</p>

<ul>
<li>Black: (0, 0, 0) — no colors</li>
<li>White: (255, 255, 255) — maximum of each color</li>
<li>Red: (255, 0, 0) — pure red, no other colors</li>
</ul>

<p>We can map out all colors in a “color space”, <a href="https://en.wikipedia.org/wiki/RGB_color_model">like so</a>:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/colorcube.png" alt="color cube" /></p>

<p>We can get distance between colors the usual way: get the distance from our (red, green, blue) value to black (0,0,0) [formally labeled <a href="http://colorspan.com/support/tools/deltae.asp">delta e</a>]. It appears humans can’t tell the difference between colors only 4 units apart; heck, even 30 units looks pretty close to me:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/colordistance.png" alt="color distance" class="webpexpress-processed"></p>

<p>How similar do these look to you? The color distance gives us a <strong>quantifiable</strong> way to measure the distance between colors (<a href="http://instacalc.com/22239">try for yourself</a>). You can even <a href="http://dheera.net/projects/blur.php">unscramble certain blurred images</a> by cleverly applying color distance.</p>

<h2>The Point: You can measure anything</h2>

<p>If you can represent a set of characteristics with numbers, you can compare them with the theorem:</p>

<ul>
<li>Temperatures during the week: (Mon, Tues, Wed, Thurs, Fri). Compare successive weeks to see how “different” they are (find the difference between 5-dimensional vectors).</li>
<li>Number of customers coming into a store hour-by-hour, day-by-day, or week-by-week</li>
<li>SpaceTime distance: (latitude, longitude, altitude, date). Useful if you’re making a time machine (or a video game that uses one)!</li>
<li>Differences between people: (Height, Weight, Age)</li>
<li>Differences between companies: (Revenue, Profit, Market Cap)</li>
</ul>

<p>You can tweak the distance by weighing traits differently (i.e., multiplying the age difference by a certain factor). But the core idea is so important I’ll repeat it again: <strong>if you can quantify it, you can compare it using the Pythagorean Theorem.</strong></p>

<p>Your x, y and z axes can represent any quantity. And you aren’t limited to 3 dimensions. Sure, mathematicians would love to tell you about the other ways to measure distance (aka <a href="https://en.wikipedia.org/wiki/Metric_space">metric space</a>), but the Pythagorean Theorem is the most famous and a great starting point.</p>

<h2>So, What Just Happened Here?</h2>

<p>There’s so much to learn when revisiting concepts we were “taught”. Math is beautiful, but the elegance is usually buried under mechanical proofs and a wall of equations. We don’t need more proofs; we need interesting, intuitive results.</p>

<p>For example, the Pythagorean Theorem:</p>

<ul>
<li>Works for <strong>any shape</strong>, not just triangles (like circles)</li>
<li>Works for <strong>any equation with squares</strong> (like 1/2 m v<sup>2</sup>)</li>
<li>Generalizes to <strong>any number of dimensions</strong> (a<sup>2</sup> + b<sup>2</sup> + c<sup>2</sup> + …)</li>
<li>Measures <strong>any type of distance</strong> (i.e. between colors or movie preferences)</li>
</ul>

<p>Not too bad for a 2000-year old result, right? This is quite a brainful, so I’ll finish here for today (the <a href="https://betterexplained.com/articles/surprising-uses-of-the-pythagorean-theorem/">previous article</a> has more uses). Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/feed/</wfw:commentRss>
			<slash:comments>119</slash:comments>
		

			</item>
	<item>
		<title>Surprising Uses of the Pythagorean Theorem</title>
		<link>https://betterexplained.com/articles/surprising-uses-of-the-pythagorean-theorem/</link>
					<comments>https://betterexplained.com/articles/surprising-uses-of-the-pythagorean-theorem/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Wed, 24 Oct 2007 23:16:05 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Popular]]></category>
				<category><![CDATA[Pythagorean Theorem]]></category>
		<guid isPermaLink="false">http://betterexplained.com/articles/a-surprising-look-at-the-pythagorean-theorem/</guid>

					<description><![CDATA[The Pythagorean theorem is a celebrity: if an equation can make it into the Simpsons , I'd say it's well-known. But most of us think the formula only applies to triangles and geometry. Think again. The Pythagorean Theorem can be used with any shape and for any formula that squares a number . Read on [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The Pythagorean theorem is a celebrity: if an equation can make it into <a href="http://www.simpsonsarchive.com/episodes/1F08.html">the Simpsons</a>, I'd say it's well-known.</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/b6dd3bb282beb5c5bd30432d0c8b52e5.png' width='94' height='18' alt='\displaystyle{a^2 + b^2 = c^2}' class='tex'></p>

<p>But most of us think the formula only applies to triangles and geometry. Think again. The Pythagorean Theorem can be used with <strong>any shape</strong> and for <strong>any formula that squares a number</strong>.</p>

<p>Read on to see how this 2500-year-old idea can help us understand computer science, physics, even the value of Web 2.0 social networks.</p>

<h2>Understanding How Area Works</h2>

<p>I love seeing old topics in a new light and discovering the depth there. For example, I realize I didn't have a <strong>deep grasp</strong> of area until writing this article. Yes, we can rattle off equations, but do we really <em>understand</em> the nature of area? This fact may surprise you:</p>

<p>The area of <strong>any shape</strong> can be computed from <strong>any line segment squared</strong>. In a square, our "line segment" is usually a side, and the area is that side squared (side 5, area 25). In a circle, the line segment is often the radius, and the area is pi * r^2 (radius 5, area 25 pi). Easy enough.</p>

<p><strong>We can pick any line segment</strong> and figure out area from it: every line segment has an "area factor" in this universal equation:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/a4afb3c78f950300897ac5fa6743fe89.png' width='245' height='21' alt='\displaystyle{\text{Area} = \text{Factor} \cdot (\text{line segment})^2}' class='tex'></p>

<p><style type="text/css">#area-table th{text-align:center}#area-table td{text-align:center}</style></p>

<table style="border: 1px solid #ccc; text-align: middle;" width="100%" id="area-table">
<tbody><tr style="border: 1px solid #ccc">
    <th><b>Shape</b></th>
    <th><b>Line Segment</b></th>
    <th><b>Area</b></th>
    <th><b>Area Factor</b></th>
</tr>
<tr>
    <td>Square<br>
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/square1.png" alt="Surprising Uses of the Pythagorean Theorem" class="webpexpress-processed">
</td>
    <td>Side [s]</td>
    <td>s<sup>2</sup></td>
    <td>1</td>
</tr>
<tr>
    <td>Square<br>
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/square_perimeter.png" alt="Surprising Uses of the Pythagorean Theorem" class="webpexpress-processed">
</td>
    <td>Perimeter [p]</td>
    <td>1/16 p<sup>2</sup></td>
    <td>1/16</td>
</tr>
<tr>
    <td>Square<br>
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/square_diagonal.png" alt="Surprising Uses of the Pythagorean Theorem" class="webpexpress-processed">
</td>
    <td>Diagonal [d]</td>
    <td>1/2 d<sup>2</sup></td>
    <td>1/2</td>
</tr>
<tr>
    <td>Circle<br>
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/circle1.png" alt="Surprising Uses of the Pythagorean Theorem" class="webpexpress-processed">
</td>
    <td>Radius [r]</td>
    <td>pi r<sup>2</sup></td>
    <td>pi (3.14159...)</td>
</tr>
</tbody></table>

<p>For example, look at the diagonal of a square ("d"). A regular side is <img src="https://betterexplained.com/latex/f1292df069585c4ff703.png" alt="$\frac{d}{\sqrt{2}}$" width="26" height="27" style="vertical-align:-10.67px" class="bex-math"></img>, so the area becomes <img src="https://betterexplained.com/latex/3acfc5dda23c89b7c4db.png" alt="$\frac{1}{2} d^2$" width="32" height="22" style="vertical-align:-6.25px" class="bex-math"></img>. Our "area constant" is 1/2 in this case, if we want to use the diagonal as our line segment to be squared.</p>

<p>Now, use the <strong>entire perimeter ("p")</strong> as the line segment. A side is <img src="https://betterexplained.com/latex/13d289e387d14a66195d.png" alt="$\frac{p}{4}$" width="15" height="21" style="vertical-align:-6.25px" class="bex-math"></img>, so the area is <img src="https://betterexplained.com/latex/5533bb116a81baaa4052.png" alt="$\frac{p^2}{16}$" width="21" height="26" style="vertical-align:-6.53px" class="bex-math"></img>. The area factor is 1/16 if we want to use <img src="https://betterexplained.com/latex/e56af09079b28036c1bc.png" alt="$p^2$" width="18" height="19" style="vertical-align:-3.51px" class="bex-math"></img>.</p>

<h2>Can we pick any line segment?</h2>

<p>You bet. There is always <strong>some</strong> relationship between the "traditional" line segment (the side of a square), and the one you pick (the perimeter, which happens to be 4 times a side). Since we can convert between the "traditional" and "new" segment, it doesn't matter which one we use -- there'll just be a different area factor when we multiply it out.</p>

<h2>Can we pick any shape?</h2>

<p>Sort of. A given area formula works for all <strong>similar</strong> shapes, where "similar" means "zoomed versions of each other". For example:</p>

<ul>
<li>All squares are similar (area always <img src="https://betterexplained.com/latex/2ce4b6b182c1d87aa6f1.png" alt="$s^2$" width="17" height="16" style="vertical-align:-0.18px" class="bex-math"></img>)</li>
<li>All circles are similar, too (area always <img src="https://betterexplained.com/latex/b9baab112ddf28c730e1.png" alt="$\pi r^2$" width="27" height="16" style="vertical-align:-0.2px" class="bex-math"></img>)</li>
<li>Triangles are <strong>not similar</strong>: Some are fat and others skinny -- every "type" of triangle has its own area factor based on the line segment you are using. Change the shape of the triangle and the equation changes.</li>
</ul>

<p>Yes, every triangle follows the rule "area = 1/2 base * height". But the relationship between base and height depends on the type of triangle (base = 2 * height, base = 3 * height, etc.), so even then the area factor will be different.</p>

<p>Why do we need similar shapes to keep the same area equation? Intuitively, when you zoom (scale) a shape, you're changing the absolute size but not the relative ratios within the shape. A square, no matter how zoomed, has a perimeter = 4 * side.</p>

<p>Because the "area factor" is based on ratios inside the shape, any shapes with the same "ratios" will follow the same formula. It's a bit like saying everyone's armspan is about equal to their height. No matter if you're a <span class="caps">NBA </span>basketball player or child, the equation holds because it's all relative. (This intuitive argument may not satisfy a mathematical mind -- in that case, take up your concerns with <a href="http://aleph0.clarku.edu/~djoyce/java/elements/bookVI/propVI20.html">Euclid</a>).</p>

<p>I hope these high-level concepts make sense:</p>

<ul>
<li>Area can be found from <strong>any line segment squared</strong>, not just the "side" or "radius"</li>
<li>Each line segment has a different "area factor"</li>
<li>The same area equation works for similar shapes</li>
</ul>

<h2>Intuitive Look at The Pythagorean Theorem</h2>

<p>We can all agree the Pythagorean Theorem is true (here's <a href="http://www.cut-the-knot.org/pythagoras/index.shtml">75 proofs</a>). But most proofs offer a mechanical understanding: re-arrange the shapes, and voila, the equation holds. But is it really clear, intuitively, that it <strong>must</strong> be a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup> and not 2a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup>? No? Well, let's build some intuition.</p>

<p>There's one killer concept we need: <strong>Any right triangle can be split into two similar right triangles.</strong></p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/proof1.png" alt="pythagorean theorem proof by similarity" class="webpexpress-processed"></p>

<p>Cool, huh? Drawing a perpendicular line through the point splits a right triangle into two smaller ones. Geometry lovers, try the proof yourself: use angle-angle-angle similarity.</p>

<p>This diagram also makes something very clear:</p>

<ul>
<li>Area (Big) = Area (Medium) + Area (Small)</li>
</ul>

<p>Makes sense, right? The smaller triangles were cut from the big one, so the areas must add up. And the kicker: because the <strong>triangles are similar, they have the same area equation.</strong></p>

<p>Let's call the long side c (5), the middle side b (4), and the small side a (3). Our area equation for these triangles is:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/97573ac51096d1384f8ebca584ddcbc7.png' width='189' height='21' alt='\displaystyle{\text{Area} = F * \text{hypotenuse}^2}' class='tex'></p>

<p>where F is some area factor (6/25 or .24 in this case; the exact number doesn't matter). Now let's play with the equation:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/0d124891cc6a0526eebb85fe4d62f42c.png' width='355' height='19' alt='\displaystyle{\text{Area (Big)} = \text{Area (Medium)} + \text{Area (Small)}}' class='tex'></p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/db37b4088392174c977843b9dfb3394b.png' width='136' height='18' alt='\displaystyle{F c^2 = F b^2 + F a^2}' class='tex'></p>

<p>Divide by F on both sides and you get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/956b37ed3b28bf830792b33c81c5b918.png' width='94' height='18' alt='\displaystyle{c^2 = b^2 + a^2}' class='tex'></p>

<p>Which is our famous theorem! You knew it was true, but now you <strong>know why</strong>:</p>

<ul>
<li>A triangle can be split into two smaller, similar ones</li>
<li>Since the areas must add up, the squared hypotenuses (which determine area) must add up as well.</li>
</ul>

<p>This takes a bit of time to see, but I hope the result is clear. How could the small triangles <strong>not</strong> add to the larger one?</p>

<p>Actually, it turns out the Pythagorean Theorem depends on the assumptions of Euclidean geometry and doesn't work on spheres or globes, for example. But we'll save that discussion for another time.</p>

<h2>Useful Application: Try Any Shape</h2>

<p>We used triangles in our diagram, the simplest 2-D shape. But the line segment can belong to <strong>any</strong> shape. Take circles, for example:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/example1.png" alt="pythagorean theorem circle" class="webpexpress-processed"></p>

<p>Now what happens when we add them together?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/pythagorean/example_circles.png" alt="circle areas" class="webpexpress-processed"></p>

<p>You guessed it: Circle of radius 5 = Circle of radius 4 + Circle of radius 3.</p>

<p>Pretty wild, eh? We can multiply the Pythagorean Theorem by our area factor (pi, in this case) and come up with a relationship for any shape.</p>

<p>Remember, the line segment can be <strong>any portion of the shape</strong>. We could have picked the circle's radius, diameter, or circumference -- there would be a different area factor, but the 3-4-5 relationship would still hold.</p>

<p>So, whether you're adding up pizzas or Richard Nixon masks, the Pythagorean theorem helps you relate the areas of any similar shapes. Now that's something they didn't teach you in grade school.</p>

<h2>Useful Application: Conservation of Squares</h2>

<p>The Pythagorean Theorem applies to <strong>any</strong> equation that has a square. The triangle-splitting means you can split any amount (c<sup>2</sup>) into two smaller amounts (a<sup>2</sup> + b<sup>2</sup>) based on the sides of a right triangle. In reality, the "length" of a side can be distance, energy, work, time, or even people in a social network:</p>

<p><strong>Social Networks.</strong></p>

<p><a href="https://en.wikipedia.org/wiki/Metcalfe's_law">Metcalfe's Law</a> (if you believe it) says the value of a network is about n<sup>2</sup> (the number of relationships). In terms of value,</p>

<ul>
<li>Network of 50M  = Network of 40M + Network of 30M.</li>
</ul>

<p>Pretty amazing -- the 2nd and 3rd networks have 70M people total, but they aren't a coherent whole. The network with 50 million people is as valuable as the others combined.</p>

<p><strong>Computer Science</strong></p>

<p>Some programs with n inputs take n<sup>2</sup> time to run (bubble sort, for example). In terms of processing time:</p>

<ul>
<li>50 inputs = 40 inputs + 30 inputs</li>
</ul>

<p>Pretty interesting. 70 elements spread among two groups can be sorted as fast as 50 items in one group. (Yeah, there may be constant overhead/start up time, just work with me here).</p>

<p>Given this relationship, it makes sense to partition elements into separate groups and then sort the subgroups. Indeed, that's the approach used in quicksort, one of the best general-purpose sorting methods. The Pythagorean theorem helps show how sorting 50 combined elements can be as slow as sorting 30 and 40 separate ones.</p>

<p><strong>Surface Area</strong></p>

<p>The surface area of a sphere is 4 pi r<sup>2</sup>. So, in terms of surface area of spheres:</p>

<ul>
<li>Area of radius 50 = area of radius 40 + area of radius 30</li>
</ul>

<p>We don't often have spheres lying around, but boat hulls may have the same relationship (they're like deformed spheres, right?). Assuming the boats are similarly shaped, the paint needed to coat one 50 foot yacht could instead paint a 40 and 30-footer. Yowza.</p>

<p><strong>Physics</strong></p>

<p>If you remember your old physics classes, the kinetic energy of an object with mass m and velocity v is <strong>1/2 m v<sup>2</sup></strong>. In terms of energy,</p>

<ul>
<li>Energy at 500 mph = Energy at 400 mph + Energy at 300 mph</li>
</ul>

<p>With the energy used to accelerate one bullet to 500 mph, we could accelerate two others to 400 and 300 mph.</p>

<h2>Try Any Number</h2>

<p>You can use any set of numbers that make a right triangle. For example, enter a total amount (50) and one subportion (30), and the remainder will appear below:</p>

<iframe src="https://instacalc.com/11865/embed" frameborder="0" marginwidth="0" marginheight="0" width="450" height="250"></iframe>

<p>Suppose you want to see if a large pizza (16 inches) is bigger than two mediums (12 inches). Plug in 16 for C, and 12 for A. It looks like the large pizza can be split into a 12-inch and 10.5-inch pizza, so two-mediums are in fact bigger.</p>

<h2>Enjoy Your New Insight</h2>

<p>Throughout our school life we think the Pythagorean Theorem is about triangles and geometry. <strong>It's not.</strong></p>

<p>When you see a right triangle, realize the sides can represent the lengths of any portion of a shape, and the sides can represent variables in <strong>any equation</strong> that has a square. Maybe it's just me, but I find this pretty surprising.</p>

<p>There's much, much more to this beautiful theorem, such as <a href="https://betterexplained.com/articles/measure-any-distance-with-the-pythagorean-theorem/">measuring any distance</a>. Enjoy.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/surprising-uses-of-the-pythagorean-theorem/feed/</wfw:commentRss>
			<slash:comments>147</slash:comments>
		

			</item>
	</channel>
</rss>
