Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int N = teren.liczba_przedmiotow;
- int* itemsDistances = new int[N];
- printf("ilosc %d ", N);
- float minDis=10000.0;
- int indexObj = 0;
- for (int i = 0; i < N; i++){
- Wektor3 Iam = ob->wPol;
- Wektor3 target = teren.p[i].wPol;
- Wektor3 diff = Iam - target;
- float result = sqrt(diff^diff);
- if (result < minDis) {
- minDis = result;
- indexObj = i;
- }
- printf("ilosc %d", result);
- }
- printf("ilosc %d ", N);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement