Find the Angle between three points from 2D using python

I have studied the dot product from vector analysis in my school. Now that formula, I will use for finding the angle between three points. We have use multiple dimentional data like 1D, 2D, 3D and higher dimensions not only 2D. But i explained with 2D data points.

The dot product may be defined algebraically or geometrically. The geometric definition is based on the notions of angle and distance (magnitude of vectors). The equivalence of these two definitions relies on having a Cartesian coordinate system for Euclidean space.

Geometric definition:

geometric object that possesses both a magnitude and a direction. A vector can be pictured as an arrow. Its magnitude is its length, and its direction is the direction that the arrow points to. The magnitude of a vector a is denoted by ||a||. The dot product of two Euclidean vectors a and b is defined by. where θ is the angle between a and b.

Explanation:

Coding(Python):

Using math library:

Using numpy library:

--

--

--

Artificial Intelligence and Data Science

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manivannan Murugavel

Manivannan Murugavel

Artificial Intelligence and Data Science

More from Medium

6 examples of Python list append method

10 Most Frequently asked Questions in Pandas

Puzzling with Regular Expression😕

In Class Hackathon : My approach to exploratory data analysis

image of matplot