Lucas Kent e39465ad2f Changes to be committed:
new file:   Files/flashplayer_32_sa.exe
	new file:   favicon.ico
	new file:   globe.gif
	new file:   imgs/download.png
	new file:   imgs/zuck.jpg
	new file:   index.html
	new file:   other.ico
	new file:   script.js
	new file:   site.webmanifest
	new file:   sitemap.html
	new file:   styles/backround.css
	new file:   styles/border.css
	new file:   styles/fonts/Titillium_Web/OFL.txt
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf
	new file:   styles/fonts/webfontkit-20221027-163353/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2
	new file:   styles/fonts/webfontkit-20221027-165950/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2
	new file:   styles/style.css
	new file:   tools/2048/.gitignore
	new file:   tools/2048/.jshintrc
	new file:   tools/2048/CONTRIBUTING.md
	new file:   tools/2048/LICENSE.txt
	new file:   tools/2048/README.md
	new file:   tools/2048/Rakefile
	new file:   tools/2048/favicon.ico
	new file:   tools/2048/index.html
	new file:   tools/2048/js/animframe_polyfill.js
	new file:   tools/2048/js/application.js
	new file:   tools/2048/js/bind_polyfill.js
	new file:   tools/2048/js/classlist_polyfill.js
	new file:   tools/2048/js/game_manager.js
	new file:   tools/2048/js/grid.js
	new file:   tools/2048/js/html_actuator.js
	new file:   tools/2048/js/keyboard_input_manager.js
	new file:   tools/2048/js/local_storage_manager.js
	new file:   tools/2048/js/tile.js
    new file:   tools/2048/meta/apple-touch-icon.png
	new file:   tools/webretro/cores/neocd_libretro.js
	new file:   tools/webretro/cores/neocd_libretro.wasm
	new file:   tools/webretro/cores/nestopia_libretro.js
	new file:   tools/webretro/cores/nestopia_libretro.wasm
	new file:   tools/webretro/cores/o2em_libretro.js
	new file:   tools/webretro/cores/o2em_libretro.wasm
	new file:   tools/webretro/cores/opera_libretro.js
	new file:   tools/webretro/cores/opera_libretro.wasm
2022-11-02 08:40:01 -04:00

233 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en"><!-- #BeginTemplate "/Templates/Advanced.dwt" --><!-- DW6 -->
<!-- Mirrored from www.mathsisfun.com/algebra/vectors-dot-product.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:36:57 GMT -->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- #BeginEditable "doctitle" -->
<title>Dot Product</title>
<meta name="description" content="Math explained in easy language, plus puzzles, games, quizzes, worksheets and a forum. For K-12 kids, teachers and parents.">
<!-- #EndEditable -->
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="HandheldFriendly" content="true">
<meta name="referrer" content="always">
<link rel="preload" href="../images/style/font-champ-bold.ttf" as="font" type="font/ttf" crossorigin="">
<link rel="preload" href="../style4.css" as="style">
<link rel="preload" href="../main4.js" as="script">
<link rel="stylesheet" href="../style4.css">
<script src="../main4.js" defer="defer"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-29771508-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-29771508-1');
</script>
</head>
<body id="bodybg" class="adv">
<div id="stt"></div>
<div id="adTop"></div>
<header>
<div id="hdr"></div>
<div id="tran"></div>
<div id="adHide"></div>
<div id="cookOK"></div>
</header>
<div class="mid">
<nav>
<div id="menuWide" class="menu"></div>
<div id="logo"><a href="../index.html"><img src="../images/style/logo-adv.svg" alt="Math is Fun Advanced"></a></div>
<div id="search" role="search"></div>
<div id="linkto"></div>
<div id="menuSlim" class="menu"></div>
<div id="menuTiny" class="menu"></div>
</nav>
<div id="extra"></div>
<article id="content" role="main">
<!-- #BeginEditable "Body" -->
<h1 class="center">Dot Product</h1>
<p>A <a href="vectors.html">vector</a> has <b>magnitude</b> (how long it is) and <b>direction</b>:</p>
<p class="center"><img src="images/vector-mag-dir.svg" alt="vector magnitude and direction" height="137" width="267"></p>
<p>Here are two vectors:</p>
<p class="center"><img src="images/vectors.svg" alt="vectors" height="" width=""></p>
<p>They can be <b>multiplied</b> using the "<b>Dot Product</b>" (also see <a href="vectors-cross-product.html">Cross Product</a>).</p>
<h2>Calculating</h2>
<p>The Dot Product is written using a central dot:</p>
<p class="center"><span class="large"><b>a</b> · <b>b</b></span><br>
This means the Dot Product of <b>a</b> and <b>b</b></p>
<p>We can calculate the Dot Product of two vectors this way:</p>
<p style="float:left; margin: 0 30px 5px 0;"><img src="images/dot-product-1.svg" alt="dot product magnitudes and angle" height="" width=""></p>
<p class="center"><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(θ)</p>
<p>Where:<br>
|<b>a</b>| is the magnitude (length) of vector <b>a</b><br>
|<b>b</b>| is the magnitude (length) of vector <b>b<br>
</b> θ is the angle between <b>a</b> and <b>b</b></p>
<p>So we multiply the length of <b>a</b> times the length of <b>b</b>, then multiply by the cosine of the angle between <b>a</b> and <b>b</b></p>
<p>&nbsp;</p>
<p>OR we can calculate it this way:</p>
<p style="float:left; margin: 0 30px 5px 0;"><img src="images/dot-product-2.svg" alt="dot product components"></p>
<p class="center"><b>a · b</b> = a<sub>x</sub> × b<sub>x</sub> + a<sub>y</sub> × b<sub>y</sub></p>
<p>So we multiply the x's, multiply the y's, then add.</p>
<div style="clear:both"></div>
<p>Both methods work!</p>
<p>And the result is a <b>number</b> (called a "scalar" to show it is not a vector).</p>
<div class="example">
<h3>Example: Calculate the dot product of vectors <b>a</b> and <b>b</b>:</h3>
<p class="center"><img src="images/dot-product-ex1.gif" alt="dot product example" height="202" width="214"></p>
<p><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(θ)</p>
<div class="so"><b>a · b</b> = 10 × 13 × cos(59.5°) </div>
<div class="so"><b>a · b</b> = 10 × 13 × 0.5075...</div>
<div class="so"><b>a · b</b> = 65.98... = 66 (rounded)</div>
<p>OR we can calculate it this way:</p>
<p><b>a · b</b> = a<sub>x</sub> × b<sub>x</sub> + a<sub>y</sub> × b<sub>y</sub></p>
<div class="so"><b>a · b</b> = -6 × 5 + 8 × 12</div>
<div class="so"><b>a · b</b> = -30 + 96</div>
<div class="so"><b>a · b</b> = 66</div>
<p>Both methods came up with the same result (after rounding)</p>
<p>Also note that we used <b>minus 6</b> for a<sub>x</sub> (it is heading in the negative x-direction)</p>
</div>
<p>Note: you can use the <a href="vector-calculator.html">Vector Calculator</a>
to help you.</p>
<h2>Why cos(θ) ?</h2>
<p>OK, to multiply two vectors it makes sense to multiply their lengths together <i><b>but only when they point in the same direction</b></i><b>.</b></p>
<p>So we make one "point in the same direction" as the other by multiplying by cos(θ):</p>
<table style="border: 0; margin:auto;">
<tbody>
<tr>
<td style="text-align:center;">&nbsp;<img src="images/dot-product-a-cos.svg" alt="dot product |a| cos(theta)" height="131" width="144"></td>
<td style="text-align:center; width:50px;">&nbsp;</td>
<td style="text-align:center;"><img src="images/dot-product-light.svg" alt="dot product shine light" height="245" width="176"></td>
</tr>
<tr>
<td style="text-align:center;">We take the component of <b>a</b><br>
that lies alongside <b>b</b></td>
<td style="text-align:center; width:50px;">&nbsp;</td>
<td style="text-align:center;">Like shining a light to see<br>
where the shadow lies</td>
</tr>
</tbody></table>
<p>THEN we multiply !</p>
<table width="100%" border="0">
<tbody>
<tr>
<td>
<p>It works exactly the same if we "projected" <b>b</b> alongside <b>a</b> then multiplied:</p>
<p>Because it doesn't matter which order we do the multiplication:</p>
<p class="center">|<b>a</b>| × <span class="hilite">|<b>b</b>| × cos(θ)</span> = <span class="hilite">|<b>a</b>| × cos(θ)</span> × |<b>b</b>|</p>
</td>
<td><img src="images/dot-product-b-cos.gif" alt="dot product |b| cos(theta)" height="136" width="183"></td>
</tr>
</tbody></table>
<h2>Right Angles</h2>
<p>When two vectors are at right angles to each other the dot product is <b>zero</b>.</p>
<div class="example">
<h3>Example: calculate the Dot Product for:</h3>
<p class="center"><img src="images/dot-product-right-angle.gif" alt="dot product right angle" height="104" width="164"></p>
<p><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(θ)</p>
<div class="so"><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(90°) </div>
<div class="so"><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × 0 </div>
<div class="so"><b>a · b</b> = 0</div>
<p>or we can calculate it this way:</p>
<p><b>a · b</b> = a<sub>x</sub> × b<sub>x</sub> + a<sub>y</sub> × b<sub>y</sub></p>
<div class="so"><b>a · b</b> = -12 × 12 + 16 × 9</div>
<div class="so"><b>a · b</b> = -144 + 144</div>
<div class="so"><b>a · b</b> = 0</div>
</div>
<p>This can be a handy way to find out if two vectors are at right angles.</p>
<h2>Three or More Dimensions</h2>
<p>This all works fine in 3 (or more) dimensions, too.</p>
<p>And can actually be very useful!</p>
<div class="example">
<h3>Example: Sam has measured the end-points of two poles, and wants to know <b>the angle between them</b>:</h3>
<p class="center"><img src="images/dot-product-ex2.gif" alt="dot product 3d" height="261" width="317"></p>
<p>We have 3 dimensions, so don't forget the z-components:</p>
<p><b>a · b</b> = a<sub>x</sub> × b<sub>x</sub> + a<sub>y</sub> × b<sub>y</sub> + a<sub>z</sub> × b<sub>z</sub></p>
<div class="so"><b>a · b</b> = 9 × 4 + 2 × 8 + 7 × 10</div>
<div class="so"><b>a · b</b> = 36 + 16 + 70 </div>
<div class="so"><b>a · b</b> = 122</div>
<p>&nbsp;</p>
<p>Now for the other formula:</p>
<p><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(θ)</p>
<p>But what is |<b>a</b>| ? It is the magnitude, or length, of the vector <b>a</b>. We can use <a href="../pythagoras.html">Pythagoras</a>:</p>
<ul>
<li>|<b>a</b>| = √(4<sup>2</sup> + 8<sup>2</sup> + 10<sup>2</sup>)</li>
<li>|<b>a</b>| = √(16 + 64 + 100)</li>
<li>|<b>a</b>| = √180</li>
</ul>
<p>Likewise for |<b>b</b>|:</p>
<ul>
<li>|<b>b</b>| = √(9<sup>2</sup> + 2<sup>2</sup> + 7<sup>2</sup>)</li>
<li>|<b>b</b>| = √(81 + 4 + 49)</li>
<li>|<b>b</b>| = √134</li>
</ul>
<p>And we know from the calculation above that <b>a · b</b> = 122, so:</p>
<p><b>a · b</b> = |<b>a</b>| × |<b>b</b>| × cos(θ)</p>
<div class="so">122 = √180 × √134 × cos(θ) </div>
<div class="so">cos(θ) = 122 / (√180 × √134)</div>
<div class="so">cos(θ) = 0.7855...</div>
<div class="so">θ = cos<sup>-1</sup>(0.7855...) = 38.2...°</div>
<p>Done!</p>
</div>
<p>I tried a calculation like that once, but worked all in angles and distances ... it was very hard, involved lots of trigonometry, and my brain hurt. The method above is much easier.</p>
<h2>Cross Product</h2>
<p>The Dot Product gives a <b>scalar</b> (ordinary number) answer, and is sometimes called the <b>scalar product</b>.</p>
<p>But there is also the <a href="vectors-cross-product.html">Cross Product</a> which gives a <b>vector</b> as an answer, and is sometimes called the <b>vector product</b>.</p>
<p>&nbsp;</p>
<div class="questions">3036, 3037, 3030, 3031, 3032, 3033, 3034, 3035, 3903, 3904</div>
<div class="related">
<a href="vectors.html">Vectors</a>
<a href="vector-calculator.html">Vector Calculator</a>
<a href="index.html">Algebra Index</a>
</div>
<!-- #EndEditable -->
</article>
<div id="adend" class="centerfull noprint"></div>
<footer id="footer" class="centerfull noprint"></footer>
<div id="copyrt">Copyright © 2022 Rod Pierce</div>
</div>
</body><!-- #EndTemplate -->
<!-- Mirrored from www.mathsisfun.com/algebra/vectors-dot-product.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:36:59 GMT -->
</html>