1. ## integer distribution help

not sure if this is the right place to put this however my problem is as follows.

I have n points
and a space with n size in which to distribute my points.

example 100 points

and a space of 800 pixels

start point would be 0 and end point would be 800 in our space available
how do I distribute the remaining 98 points evenly across the available space.

What area of math is this in so that I may do the proper research.

Thanks for any help in advance.

Baker

2. It is the space left divided by the points you need to distribute evenly

In your case each would be $\displaystyle \dfrac{800-0}{98}$ apart.

In general it is $\displaystyle \dfrac{s_f - s_i}{n}$ where $\displaystyle s_f$ is the end point, $\displaystyle s_i$ the start point and $\displaystyle n$ the number of dots

3. wow that was crazy fast. perhaps you could elaborate on another issue for me say the num points was greater than the available space. I would then want to scale the shown points.

example if every 10 points had a different color when scaled then every 100 or 20 or whatever amount would be colored different. how would i determine the scale factor.

I hope this makes sense.

Baker

4. $\displaystyle \dfrac{s_f - s_i}{n} \times \dfrac{a}{s_f-s_i} = \dfrac{a}{n}$

Where $\displaystyle a$ is the new distance

edit: I should point out the scale factor is given by the new length divided by the old length so your scale factor is $\displaystyle \dfrac{a}{s_f-s_i}$

5. I am not sure what you mean by new distance... if there are more points than can be displayed I would like to draw some main grid points.
Essentially having the same number of points displayed but the line would still represent the same num points 0-1000 for example and our available space would stay the same. like our previous example 0-800 is available space our num points is 1000. however we can only display a maximum of 800 points how do i determine these point while still representing the entire list 0-1000 points.

I really appreciate your help btw.
`Baker

6. I am still having trouble with this problem, because I am using an integer based system I cannot use precision numbers to calc these new positions. I usually end up with a number too high or too low of the last point. usually a remainder of + or - 40 units.