Google around "angle between two lines". This will give you the formula to convert two slopes into an angle using atan() (you'll need to #include <cmath>).
Once you have the three angles of your triangle, choose the smallest and calculate the cosine.
I would like to help but cannot due to your usage of these mysterious ccc_win based objects.
Does a Point variable (say p1) have data members like p1.x and p1.y?
If we can get at the raw x,y values (integer, float, double - whatever type they are) for each of the points then a calculation can be made.
Please show how to extract these numbers from a Point variable.
But i cant assign variables, because i must use get_mouse.(I think i cant assign variables, if i am wrong correct me.)
You're wrong. See here:
1 2 3
Point p1 = cwin.get_mouse("");
Point p2 = cwin.get_mouse("");
Point p3 = cwin.get_mouse("");
that assigns the variables p1, p2, and p3 with the coords of where the user clicked.
below that you have lines 'a', 'b', and 'c' which form the triangle.
You have everything you need to calculate the cosine of the minimal angle. All that's left is for you to do the math involved with the variables you already have.
ok moorecm, but i think u should explain to me whats internet first, i am a monkey,u know..
I am in trouble, i though here i will find some help, but again someone thinks that he is God..