[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reverse interpolation?

Simon de Vet wrote:

> I understand how to use a subscript to find an interpolated value. How
> would I go in the opposite direction, using a value to find a subscript?

I have an idea (I used this for a similar problem with Matlab) that may
work. It's ackward and bulky, but I can understand it.

First, I subtract the known altitude from the altitude list. Some of the
values will be positive, and some negative. I use this to find the points
on either side of known altitude. I can use their subscripts as x-values
and their altitudes as y-values to find the equation of a line connecting
the two points. I can then substitute my known altitude (y value) into the
equation, and solve for x (the required subscript).

I hope it works.