How to compute angle of two points using tangent in a plan?

60 Views Asked by At

I have to realize a wrapper for $n$ points given by the user, where $2 \le n \le 10$. Therefore, I have to be able to know the order of covering all the points and generating the figure. So, I want to compute the angle between each two points using tangent and based on the value of each of that computed angle to be able to know the correct order of covering the points. How can I computed the angle of two points using tangent?

Thank you and sorry for not explaining it thoroughly, this is my first question here, since I was advised to look for the answer to my problem. I will reedit it if some aspects a re not clear. Thank you for your time and patience.

Edit: Added pictures:

For example, The user enters 4 points: 1(x1,y1), 2(x2,y2), 3(x3,y3), 4(x4,y4) (See Image)

I want to generate a wrapper of the form to look like this, a convex figure (See Image)

And not to get a concave figure, with the same points (See Image)

1

There are 1 best solutions below

0
On BEST ANSWER

I found a great solution to my problem: Convex Hull algorithm written in several programming languages + Demo on how to use it.

Maybe it will be useful to others as it was to me.

Thank you for your help, I wouldn't have known the name of the algorithm without you guys. :)