Professional Documents
Culture Documents
Cartesian Plane: Distance Formula: Video Companion
Cartesian Plane: Distance Formula: Video Companion
1 Introduction
In this video:
• Nearest neighbors
• Clustering
2 Pythagorean theorem
z y
z 2 = x2 + y 2
p
z = x2 + y 2
1
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University
C = (c, d)
A = (a, b) (c, b)
Distance formula:
p
dist(A, C) = (c − a)2 + (d − b)2
2
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University
B = (5, 4)
A = (1, 1)
D = ( 32 , 1)∗
x
O = (0, 0)
p
dist(A, B) = (5 − 1)2 + (4 − 1)2
=5
p
dist(A, O) = (1 − 0)2 + (1 − 0)2
√
= 2 ≈ 1.4
s 2
3
dist(A, D) = − 1 + (1 − 1)2
2
1
=
2
*Note that the x and y values of point D are reversed in the video, but it does not matter
in calculating the distance from A.
3
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University
Consider set S:
S = {O, B, D}
5 Clustering
y A I
II
C
x
D III