All pastes #738476 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-16 10:53 UTC
rendered paste body
I'm trying to plot points on a graph but I'm running into some problems.

The total vertical height of the graph is 119 pixels.

The value I want to plot can be any number from 0 to infinity.

I'll use two sets of numbers as an example.

This is the method I've been trying to use.
1) High point = 1492, Low point = 16
1492 - 16 = 1476
119 / 1476 = 0.080623306233062330623306233062331
With this number I know the difference in height between each pixel that needs plotted.
The problem is that the low point can never truly be 0?

2) High point = 43, Low point = 21
43 - 21 = 22
119 / 22 = 5.4090909090909090909090909090909
The problem with this is that if I multiply that by 43, I end up with a number higher than 119.

What could I use to get an accurate height value for each pixel no matter how high the value,
and with the lowest point being 0 and the highest point being 119?