0

Answer

The solution to my question is $10^{\log{logMin}+\frac{x-linMin}{linMax-linMin}(\log{logMax}−\log{logMin})}$ with $x$ being a value on a linear scale $linMin$ to $linMax$ that is being converted to the logarithmic scale $logMin$ to $logMax$.

Question

I've already looked here Convert a linear scale to a logarithmic scale but the answer provided is specific to the question posters values and since I can't add comments I'm asking again:

Given a logarithmic scale and a linear scale, how do I interpret a linear value as a logarthmic value.

Given are 5 values, a value on the linear scale, the minimal value on either scales and the maximal values on either scales.

liMin |---[xLin]--------| liMax
              |
      f(xLin) = ? = xLog
              v
loMin |---[xLog]--------| loMax

(Actual example)

Lin: 0   |------[5]------| 10
                 |
          f(5) = ? = 1
                 v
Log: 0.1 |------[1]------| 10

What I figuered so far from the thread is that you have two equations

$loMin=k\log {liMin}+c$ and

$loMax=k\log {liMax}+c$.

Solving those for $c$ and $k$ will net

$k = \frac {loMax - loMin}{\log{liMax} - \log{liMin}}$ and

$c = \frac {loMin\log{liMax}-loMax\log{liMin}}{\log{liMax}-\log{liMin}}$.

Putting those into $f(x)=k\log{x}+c$ completely wrong results though.

Is this the correct appoach or am I doing something wrong?#

Marv
  • 103

1 Answers1

1

You should not expect the linear relationship you use to find $c,k$. It sounds like you are trying to look at the position of a point on the linear scale toget a value and find the appropriate position of the value on the log scale. Say you linear scale runs from $1$ to $100$. A point one third of the way along would correspond to $1+\frac 13(100-1)=34$. The range of the logs (using base $10$) is $0$ to $2$. As $\log_{10}34 \approx1.53$, you would plot $34$ at $\frac 12(1.53-0)$ or $0.76$ of the way along the scale.

Ross Millikan
  • 374,822
  • What I am looking for, assuming my linear scale for example is 0 to 10 and my log scale is 0.1 to 10, the conversion from the linear point at 3 (0.3 along the linear scale) to the unknown point xLog 0.3 along the logarithmic scale. Or, using a linear value of 5 (0.5 along the linear scale), the function should give 1 (0.5 along the logarithmic scale). I hope this makes it a little clearer. edit: Added the example to my question. – Marv Dec 11 '14 at 23:37
  • 1
    To find where $3$ goes on a log scale from $0.1$ to $10$, it goes $\frac {\log 3 - \log 0.1}{\log 10 - \log 0.1}=\frac {.477-(-1)}2=0.738$ along the way. The linear scale is just a source for the value $3$ in this case, but it may be distracting you. – Ross Millikan Dec 11 '14 at 23:44
  • This is not what I am looking for. If I have linear a scale from $0.1$ to $10$ and I use the value $3$ as my input, I need the value $\frac{3}{10-0.1} = 0.303$ along the way of the log scale, not where the $3$ is along the log scale. Please check my original question for an example. Also, the logMin/logMax and linMin/linMax are arbitrary (but $>0$). – Marv Dec 11 '14 at 23:56
  • 2
    The log of the value on the log scale would be $\log(logMin)+0.303(\log(logMax)-\log(logMin))$, so the value would be $10^{\log(logMin)+0.303(\log(logMax)-\log(logMin))}$. Your added actual example is correct-the midpoint of a log scale from $0.1$ to $10$ is indeed $1$ – Ross Millikan Dec 12 '14 at 00:00
  • This is perfect. The universal solution would then be $10^{\log{logMin}+\frac{x}{linMax-linMin}(\log{logMax}−\log{logMin})}$. I've added this to the original question. Thank you for your help. – Marv Dec 12 '14 at 00:19
  • The factor should of cause be $\frac{x-linMin}{linMax-linMin}$ and not $\frac{x}{linMax-linMin}$. – Marv Dec 12 '14 at 00:55