Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. int N = teren.liczba_przedmiotow;
  2. int* itemsDistances = new int[N];
  3. printf("ilosc %d ", N);
  4. float minDis=10000.0;
  5. int indexObj = 0;
  6. for (int i = 0; i < N; i++){
  7. Wektor3 Iam = ob->wPol;
  8. Wektor3 target = teren.p[i].wPol;
  9. Wektor3 diff = Iam - target;
  10. float result = sqrt(diff^diff);
  11. if (result < minDis) {
  12. minDis = result;
  13. indexObj = i;
  14. }
  15. printf("ilosc %d", result);
  16. }
  17. printf("ilosc %d ", N);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement