All pastes #565953 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-14 07:33 UTC
rendered paste body
list<int> getTicks(min, max, space, height){
 	y_min = round(min, 1);
	y_max = round(max, 1);
	ticks = height/space;
	tick_delta = (y_max-y_min)/ticks;
	list<int> tickmarks = new list;
	for(y=y_min;y<=y_max;y+=tick_delta){
		tickmarks.add(y);
	}
	return tickmarks;
}

float round(number, significant_figures){
	
	n = log_10(number);
	figures = n-significant_figures;
	m = number/(10^figures);
	round(m);
	return m*10^figures;
}