Application to find corners in space using python

Tram Ho

Surely everyone has learned to analyze vectors on a school chair, I am currently working on a project on analyzing body posture when doing physiotherapy, so apply the previous formulas to Find the angle created by 3 points: shoulder, hip, and knee. There are 2D, 3D spaces, but today I will apply with 2D data.

Angular formulas can be determined algebraically or geometrically. Geometrical definition is based on the concepts of angle and distance (vector magnitude). The equivalence of these two definitions depends on whether there is a Decartes coordinate system for Euclidean space.

1. Definition of geometry:

An angle of magnitude and direction. A vector can be visualized as an arrow. Its magnitude is the length and its direction is the direction the arrow points to. The magnitude of a vector a is denoted by || a ||. The dot product of two Oclit vectors a and b is determined by θ which is the angle between a and b.

Explain:

2. Formula

Using the math library:

Use numpy library

In addition, from the above formula, it is also possible to create an angle with 2 points, the remaining point is the OX axis, for example: the inclination of the body (including the shoulders and hips).

Or there is a case where the angle of the left hip – left shoulder will be different from the right hip – right back, then there will be another frame of reference opposite the ox axis to the space before, we will calculate with the following formula

Source: https://manivannan-ai.medium.com/find-the-angle-between-three-points-from-2d-using-python-348c513e2cd

Share the news now

Source : Viblo