ready

ewqe
Last edited on
well, if I recall correctly,
c2 = a2 + b2 - 2ab*cos(a^b)
If you need the smallest angle, make c to be the shortest side.
If you need more than that, ask specific questions.
deleted
Last edited on
Use a convention.
1
2
3
Point p[3];
Line l[3];
double angles[3]; //the angle between l[i] and l[(i+1)%3] 

Please just post in one place:
http://www.cplusplus.com/forum/general/31179/
http://www.cplusplus.com/forum/beginner/31182/
I am sorry about the posts in two places, but i decided that i posted a comment on a wrong page.


Mmm sorry, i dont understand that :

Point p[3];
Line l[3];
double angles[3]; //the angle between l[i] and l[(i+1)%3]

I wrote my first program - hello world, 2 weeks ago :(
Can u please explain it?
Last edited on
step by step:
1. get three points pt1, pt2 and pt3.
2. get the length of each line. store it in variables a, b and c.
3. make sure that c is the shortest line. if c > a, swap a, c. if c > b swap b, c.
4. calculate cos(a^b) from the formula I gave you.
deleted
Last edited on
How should i store the program to get the length of the lines
see http://en.wikipedia.org/wiki/Pythagorean_theorem
Though most likely there already is a function for doing that in whatever library you're using.

decide which angle is the smallest?
the smallest angle is in front of (don't know the right word) the shortest line.

deleted
Last edited on
you wrote:
what i have to write so the program automaticly will decide which is the smallest angle?
I wrote:
3. make sure that c is the shortest line. if c > a, swap a, c. if c > b swap b, c.


Line a = Line (p1, p2); That doesn't really do much.. I'll write a function for Pythagoras theorem:
1
2
3
4
float GetLength(Point a, Point b){
   return sqrt((a.get_x()-b.get_x())*(a.get_x()-b.get_x()) + (a.get_y()-b.get_y())*(a.get_y()-b.get_y()));
   //don;t forget to #include <cmath>
}
ohh, my brain will explode..I really dont know how to write the program...
Thank u so much about the answers, but if anyone can tell me what exactly i should do, will help me a lot...
Please help me !!!!!!
Topic archived. No new replies allowed.