Answer the question
In order to leave comments, you need to log in
How to switch to logarithmic scale?
Subject.
I can't think of a simple numerical method to fit x from minX=1.14E-23 to maxX=2.428272E+35 into an arbitrary given range. Let's say in x' from minX'=10 to maxX'=60000.
Those. what should be f for x'=f(x,minX,maxX,minX',maxX')
Basically minX and maxX are constants, but minX' and maxX', i.e. the boundaries of the scale to which it is necessary to move can change, albeit within narrow limits (+ - order).
Answer the question
In order to leave comments, you need to log in
It's easy. Logarithmic scale, so the first transformation is taking the logarithm:
x' = log 10 x
Got the range transformation [1.14E-23, 2.428272E+35] to [-22.94309515, 35.38529733]. Now we need to fit the resulting range into [10, 60000] with a linear transformation:
x'' = (x' - (-22.94309515)) / (35.38529733 - (-22.94309515)) * (60000 - 10) + 10
Combining the transformations together we get
x' ' = (log 10 x + 22.94309515) * 1028.487113 + 10
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question