used size_t i to top and used it for both cases.moved intreaxtrapolation block to the end.else // we need linear interpolation/extrapolation. (only last else part of your code shown) // !!!!!!!!!! indicates lines of significant change. Here's an untested implementation of that. All code beforehand basically just figures out the right index i to use, then perform the code block. To simplify your code, move the block to the end. duplicated codeįor the code, that means the following block is a duplicate: //y = y0 (y1-y0)*(x-x0)/(x1-x0) ĭouble res = y0 (y1 - y0)*(x - x0) / (x1 - x0) That's somewhat plausible I'd say, because no matter if you are interpolating or extrapolating, you are still applying the formula for a line and that's the same whether you are between two points that define the line or outside of them. $$\frac$$Īs can be seen in W\$\alpha \$ of the first and W\$\alpha \$ of the second (as the alternate forms are neatly in the same location, you can toggle between both tabs)Įven without the additional brackets around ((x - x0) / (x1 - x0)), it would still be the same thing. If (detail_sensativity >= min
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |