Course:
Data Visualization
Instructor: Mr. Abdul Baqi Malik
Lecture No.08 AI-SP-23
16-Dec-25 1
❑Euclidean distance is a measure of the straight-line distance between two points in Euclidean
space. It is the most common and familiar distance metric, often referred to as the "ordinary"
distance.
❑Euclidean Distance gives the distance between any two points in an n-dimensional plane. Euclidean distance
between two points in the Euclidean space is defined as the length of the line segment joining the two
points.
❑Euclidean distance is like measuring the straightest and shortest path between two points.
❑It tells how far apart the two points are without any turns or bends, just like a bird would fly directly from
one spot to another. This metric is based on the Pythagorean theorem and is widely utilized in various fields
such as machine learning, data analysis, computer vision
Euclidean distance
16-Dec-25
2
2
❑Euclidean Distance Formula
❑Consider two points (x1, y1) and (x2, y2) in a 2-dimensional space; the Euclidean Distance between them is
given by using the formula:
Euclidean distance
16-Dec-25
3
3
❑Euclidean Distance in 3D
❑If the two points (x1, y1, z1) and (x2, y2, z2) are in a 3-dimensional space, the Euclidean Distance between
them is given by using the formula:
Euclidean distance
16-Dec-25
4
4
❑Euclidean Distance in nD
❑In general, the Euclidean Distance formula between two points (x11, x12, x13, ...., x1n) and (x21, x22, x23, ...., x2n)
in an n-dimensional space is given by the formula:
• i Ranges from 1 to n
• d is Euclidean distance
• (x11, x12, x13, ...., x1n) is Coordinate of First Point
• (x21, x22, x23, ...., x2n) is Coordinate of Second Point
Euclidean distance
16-Dec-25
5
5
❑ Euclidean Distance Formula is derived by following the steps added below:
❑ Step 1: Let us consider two points, A (x1, y1) and B (x2, y2), and d is the distance between the two points.
❑ Step 2: Join the points using a straight line (AB).
❑ Step 3: Now, let us construct a right-angled triangle whose hypotenuse is AB, as shown in the figure below.
Euclidean Distance Formula Derivation
16-Dec-25
6
6
Example
16-Dec-25
7
7
Example
16-Dec-25
8
8
Example
16-Dec-25
9
9
Example
16-Dec-25
10
10
Practice Questions
16-Dec-25
11
11
❑Taxicab geometry or Manhattan geometry is geometry where the familiar Euclidean distance is
ignored, and the distance between two points is instead defined to be the sum of the absolute
differences of their respective Cartesian coordinates, a distance function (or metric) called
the taxicab distance, Manhattan distance, or city block distance.
Manhattan geometry
16-Dec-25
12
12
❑Taxicab geometry or Manhattan geometry is geometry where the familiar Euclidean distance is
ignored, and the distance between two points is instead defined to be the sum of the absolute
differences of their respective Cartesian coordinates, a distance function (or metric) called
the taxicab distance, Manhattan distance, or city block distance.
Manhattan geometry
16-Dec-25
13
13
Manhattan geometry
16-Dec-25
14
14
Manhattan geometry
16-Dec-25
15
15
Manhattan geometry
16-Dec-25
16
16
Euclidean Distance and Manhattan Distance
16-Dec-25
17
17
❑The Jaccard index is a statistic used for gauging the similarity and diversity of sample sets. It is defined in
general taking the ratio of two sizes (areas or volumes), the intersection size divided by the union size, also
called intersection over union (IoU).
Jaccard similarity
16-Dec-25
18
18
Jaccard similarity
16-Dec-25
19
19
Jaccard similarity
16-Dec-25
20
20
Jaccard similarity
16-Dec-25
21
21
Jaccard similarity
16-Dec-25
22
22
Jaccard similarity
16-Dec-25
23
23

Data Visualization Lecture - Euclidean distance slide

  • 1.
    Course: Data Visualization Instructor: Mr.Abdul Baqi Malik Lecture No.08 AI-SP-23 16-Dec-25 1
  • 2.
    ❑Euclidean distance isa measure of the straight-line distance between two points in Euclidean space. It is the most common and familiar distance metric, often referred to as the "ordinary" distance. ❑Euclidean Distance gives the distance between any two points in an n-dimensional plane. Euclidean distance between two points in the Euclidean space is defined as the length of the line segment joining the two points. ❑Euclidean distance is like measuring the straightest and shortest path between two points. ❑It tells how far apart the two points are without any turns or bends, just like a bird would fly directly from one spot to another. This metric is based on the Pythagorean theorem and is widely utilized in various fields such as machine learning, data analysis, computer vision Euclidean distance 16-Dec-25 2 2
  • 3.
    ❑Euclidean Distance Formula ❑Considertwo points (x1, y1) and (x2, y2) in a 2-dimensional space; the Euclidean Distance between them is given by using the formula: Euclidean distance 16-Dec-25 3 3
  • 4.
    ❑Euclidean Distance in3D ❑If the two points (x1, y1, z1) and (x2, y2, z2) are in a 3-dimensional space, the Euclidean Distance between them is given by using the formula: Euclidean distance 16-Dec-25 4 4
  • 5.
    ❑Euclidean Distance innD ❑In general, the Euclidean Distance formula between two points (x11, x12, x13, ...., x1n) and (x21, x22, x23, ...., x2n) in an n-dimensional space is given by the formula: • i Ranges from 1 to n • d is Euclidean distance • (x11, x12, x13, ...., x1n) is Coordinate of First Point • (x21, x22, x23, ...., x2n) is Coordinate of Second Point Euclidean distance 16-Dec-25 5 5
  • 6.
    ❑ Euclidean DistanceFormula is derived by following the steps added below: ❑ Step 1: Let us consider two points, A (x1, y1) and B (x2, y2), and d is the distance between the two points. ❑ Step 2: Join the points using a straight line (AB). ❑ Step 3: Now, let us construct a right-angled triangle whose hypotenuse is AB, as shown in the figure below. Euclidean Distance Formula Derivation 16-Dec-25 6 6
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
    ❑Taxicab geometry orManhattan geometry is geometry where the familiar Euclidean distance is ignored, and the distance between two points is instead defined to be the sum of the absolute differences of their respective Cartesian coordinates, a distance function (or metric) called the taxicab distance, Manhattan distance, or city block distance. Manhattan geometry 16-Dec-25 12 12
  • 13.
    ❑Taxicab geometry orManhattan geometry is geometry where the familiar Euclidean distance is ignored, and the distance between two points is instead defined to be the sum of the absolute differences of their respective Cartesian coordinates, a distance function (or metric) called the taxicab distance, Manhattan distance, or city block distance. Manhattan geometry 16-Dec-25 13 13
  • 14.
  • 15.
  • 16.
  • 17.
    Euclidean Distance andManhattan Distance 16-Dec-25 17 17
  • 18.
    ❑The Jaccard indexis a statistic used for gauging the similarity and diversity of sample sets. It is defined in general taking the ratio of two sizes (areas or volumes), the intersection size divided by the union size, also called intersection over union (IoU). Jaccard similarity 16-Dec-25 18 18
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.