Guest User

Untitled

a guest
May 28th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. int angle(int d,int px,int py,int x,int y)
  2. {
  3.     float dx=(px-x)/d;//px and py are target,x and y my pod and d is distance between them
  4.     float dy=(py-y)/d;
  5.     float ang=acos(dx)*(180/3.14);
  6.     if(dy<0)
  7.     {
  8.         ang=360-ang;
  9.     }
  10.     return int(ang);
  11. }
  12. it always returning 90* only
Add Comment
Please, Sign In to add comment