> For the complete documentation index, see [llms.txt](https://kgisl.gitbook.io/lab3003/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kgisl.gitbook.io/lab3003/units/memcsv.md).

# memCSV

memCSV

```
</div>
```

<table><thead><tr><th>A</th><th>B</th></tr></thead><tbody><tr><td>Question</td><td>Answer</td></tr><tr><td><p><strong>Coordinate Geometry Terms</strong></p><p><br></p><p>Coordinate Geometry Definition - It is one of the branches of geometry where the position of a point is defined using coordinates.</p><p><br></p><p>What are the Coordinates?</p><p><br></p></td><td><p>Coordinates are a set of values which helps to show the exact position of a point in the coordinate plane.</p><p><br></p></td></tr><tr><td><p>Coordinate Plane Meaning - A coordinate plane is a 2D plane which is formed by the intersection of two perpendicular lines known as the x-axis and y-axis.</p><p><br></p><p>What is the <strong>Distance Formula</strong>?</p></td><td><p>It is used to find the distance between two points situated in <strong>A(x1,y1)</strong> and <strong>B(x2,y2)</strong></p><p><br></p><p><br></p></td></tr><tr><td><p>What is the distance between (4, 0) and (0, 0)?</p><p><br></p><p><img src="https://memcode-production.s3.us-west-2.amazonaws.com/1585923947937" alt="" data-size="original"></p></td><td><p><strong>4</strong></p><p><br></p><p><code>d = (x1 - x2)</code></p><p><code>= 4 - 0</code></p><p><code>= 4</code></p></td></tr><tr><td><p>What is the distance between (4, 3) and (4, 0)?</p><p><br></p><p><br></p><p><img src="https://memcode-production.s3.us-west-2.amazonaws.com/1585924803590" alt="" data-size="original"></p></td><td><p><strong>3</strong></p><p><br></p><p><code>d = (x1 - x2) + (y1 - y2)</code></p><p><code>= (4 - 4) + (3 - 0)</code></p><p><code>= 0 + 3</code></p><p><code>= 3</code></p></td></tr><tr><td><p>What is the distance between (4, 3) and (0, 0)?</p><p><br></p><p><img src="https://memcode-production.s3.us-west-2.amazonaws.com/1585924993650" alt="" data-size="original"></p></td><td><p>Using previous formula, we get</p><p><br></p><p><code>d = (x1 - x2) + (y1 - y2)</code></p><p><code>= (4 - 0) + (3 - 0)</code></p><p><code>= 4 + 3</code></p><p><code>= 7</code></p><p><br></p><p>But we know from <a href="https://www.mathsisfun.com/algebra/distance-2-points.html">https://www.mathsisfun.com/algebra/distance-2-points.html</a></p><p><br></p><p><img src="https://memcode-production.s3.us-west-2.amazonaws.com/1585925436666" alt="" data-size="original"></p><p><br></p></td></tr><tr><td><p>If (x1 - x2) + (y1 - y2) is giving a higher value than what is correct,</p><p><br></p><p>What can the <strong>distance formula</strong> be?</p></td><td><p>Why not square the x component and square the y component, and then reduce it down by using square root?</p><p><br></p><p>﻿(x1−x2)2+(y1−y2)2\sqrt{(x1 - x2)^2 + (y1 - y2)^2}(x1−x2)2+(y1−y2)2​﻿</p><p><br></p><p>Let’s see if it works…</p><p><br></p><p>﻿d=(x1−x2)2+(y1−y2)2d = \sqrt{(x1 - x2)^2 + (y1 - y2)^2} d=(x1−x2)2+(y1−y2)2​﻿</p><p>﻿=(4−0)2+(3−0)2 = \sqrt{(4 - 0)^2 + (3 - 0)^ 2}=(4−0)2+(3−0)2​﻿</p><p>﻿=16+9= \sqrt{16 + 9}=16+9​﻿</p><p>﻿=25= \sqrt{25}=25​﻿</p><p>﻿=5= 5=5﻿</p></td></tr><tr><td>What is the distance between <strong>(2, -1)</strong> and <strong>(5, 3)</strong>?</td><td><img src="https://memcode-production.s3.us-west-2.amazonaws.com/1585926241096" alt="" data-size="original"></td></tr><tr><td><p>What is the most logical way to represent a cartesian point in Python?</p><p><br></p><p>A. Use two variables, for e.g. x1 and y1 or x2 and y2</p><p>B. Use a single tuple variable</p><p>C. <strong>None</strong> of the above</p></td><td><p><strong>Choice B.</strong></p><p><strong>Tuple</strong> is the logical way of doing it Python.</p></td></tr><tr><td><p>What is the <a href="https://en.wikipedia.org/wiki/Syntax_(programming_languages)">syntax</a> for defining a point <code>(3, 4)</code> as a tuple in Python?</p><p><br></p><p>A. <code>(3, 4)</code></p><p>B. <code>tuple(3, 4)</code></p><p>C. Both the above are valid</p></td><td><p><strong>Choice C.</strong></p><p><br></p><p>﻿</p></td></tr><tr><td><p>How can you deconstruct a <strong>tuple</strong> that represents a point?</p><p><br></p></td><td><p>If</p><p><code>pointA = (6, 8) # construction</code></p><p><br></p><p>then</p><p><code>x1, y1 = pointA # deconstruction</code></p><p><br></p><p><code>print(x1, y1) # 6, 8</code></p><p><br></p></td></tr><tr><td><p><code>x1, y1, x2, y2 = (1, 2, 3, 4)</code></p><p><br></p><p>What is the value of <code>x1</code> and <code>y2</code>?</p></td><td><pre><code>1 and 4. 
</code></pre></td></tr><tr><td><p>Are you confident of writing the code for <strong>Distance between Two Points?</strong></p><p><br></p><p>﻿</p></td><td>Test yourself at <a href="http://j.mp/twoPoints">http://j.mp/twoPointsCC</a></td></tr></tbody></table>
