Q. How can we find the angle between two points in a 2D space as shown in the figure if the
positions are given
take this care
Point Ax = 2.8
Point Ay = 3.2
Point Bx = 5.2
Point By = 6.2
say you are doing this calculation in python here it goes in python
import math
angle = math.atan2(Bx-Ax, By-Ay)
ie
angleR = math.atan2(5.2-2.8, 6.2-3.2)
0.6747094222355274
since this result is in radians u neet to convert it to degrees using
math.degrees(angle)
38.659808254090095
Hi, one thing to take into account (to get the desired result):
ReplyDeleteatan2(y,x)