Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int angle(int d,int px,int py,int x,int y)
- {
- float dx=(px-x)/d;//px and py are target,x and y my pod and d is distance between them
- float dy=(py-y)/d;
- float ang=acos(dx)*(180/3.14);
- if(dy<0)
- {
- ang=360-ang;
- }
- return int(ang);
- }
- it always returning 90* only
Add Comment
Please, Sign In to add comment