calculate angle???
I am using that but I only get some strange words :(
I get my coordinates from x and y array..... what is the problem???
for(a=1;a<i;a++){
yyy=(y[a-1]- y[a]);
xxx=(x[a-1]- x[a]);
slope[a-1]=yyy/xxx;}
yyy=(y[i-1]- y[0]);
xxx=(x[i-1]- x[0]);
slope[i-1]=yyy/xxx;
for(b=1;b<i;b++){
yyy=(slope[b-1]+slope[b]);
xxx=(1-slope[b-1]*slope[b]);
angle=yyy/xxx;
res=acos(angle) * (180/3.14);
printf("%d. Angle %f\n",b,res);}
yyy=(slope[i-1]+slope[0]);
xxx=(1-slope[i-1]*slope[0]);
lastangle=yyy/xxx;
res=acos(lastangle) * (180/3.14);
printf("%d. Angle %f\n",b,res);
jerryseinfeld
Junior Poster in Training
55 posts since Apr 2007
Reputation Points: 8
Solved Threads: 0
What are you tryin to do ?
also provide some sample output (also expected output if possible)..
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
Choosing some more meaningful variable names rather than xxx yyy zzz etc would probably tell you a lot.
xxx / yyy is pretty meaningless, but if you had something like apples / oranges, it becomes pretty darn obvious very quickly that it is a completely stupid thing to even try.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953