comp.lang.c
[Top] [All Lists]

Re: need help with arrays

Subject: Re: need help with arrays
From: pereges
Date: Tue, 29 Apr 2008 10:34:43 -0700 PDT
Newsgroups: comp.lang.c

Ok solved.

float xsize = xlength / (numpointsx - 1);
float ysize = ylength / (numpointsy - 1);

and use <= in both loops.

With this approach, now i have extra points:

For eg. numpoints = 14000 //entered by user

actual numpoints = 14161  //161 extra

xmax = 10.170940  ( > actual xmax)
ymax = 10.170940 ( > actual ymax)

but i don't mind really

what i will do is that i am doing actual calculations, i will simply
not consider points where:

x > xmax || y > ymax

x or y cannot be less than xmin, ymin anyway


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy