Hello everyone,
I am trying to figure out the following problem. I am building Yet another math function grapher, The function is drawn on its predefined x,y range, that's all good.
Now I am working on the background and the ticking of X, Y axes (if any axes are shown).
I worked out the following. I have a fixed width of 250 p The tick gap should be between 12.5 and 50p.
The ticks should indicate either unit or half unit range, by that i mean the following.
x range (-5, 5): one tick = 1
x range (-1, 1): one tick = 0.5 or 0.1 depending on the gap that each of this option would generate.
x range (0.1, 0.3): 0.05
Given a Xrange How would you get the number of ticks between either full or half unit range ?
Or maybe there are other way to approach this type of problems.