aUCBLogo Demos and Tests / testdrawlogscale
to testdrawlogscale
printlogscale 3 8 7
drawlogscale 3 8 7
end
to printlogscale min_ max_ steps
(print "Range: min_ ".. max_ ", steps "steps,)
(print "x "y)
range=(max_-min_)/(steps-1)
repeat steps
[ x=repcount-1
y=(log10 1+9*x/(steps-1))
(print
form min_+range*x 8 3
form y 8 3)
]
end
to drawlogscale min_ max_ steps
clearScreen
WindowMode
PenUp
range=(max_-min_)/(steps-1)
repeat steps
[ x=repcount-1
y=(log10 1+9*x/(steps-1))
setXY x*30 y*300
PenDown
circle 5
PenUp
setXY -50 y*300
setHeading 90
Label y
setXY x*30 -20
setHeading 90
Label form min_+range*x 0 1
]
end