MechanicalEngineer 0 Posted May 2 (edited) Hello, lets say I have coordinates for 3 points, and I want to find a function that satisfies the following Function pass through all the points Function is strictly increasing Function type is either: exponential, logarithmic, or involves x powers; in other words, we will omit sinusoidal functions and rational functions. we can think of any number of points as an example. so, lets say: point p1 = (6.5 ,1) p2 = (7.0, 2) p3=(7.48, 3) how do I find a fitting function for these? I can easily spot that this cannot be a logarithmic function (because slope is decreasing), nor can it be in the form ax^b unliss the power is b>1 (for same reason) but what power of X is best chosen? is it better to make it in the form Ax^b or is it better to choose multiple powers? I think multiple powers wont satisfy the strictly increasing condition. the form C+ Ae^bx can be easily worked out I think, I guess I will give it a go in a minute Edited May 2 by MechanicalEngineer 0 Share this post Link to post Share on other sites

Sensei 899 Posted May 2 (edited) 11 minutes ago, MechanicalEngineer said: lets say I have coordinates for 3 points, and I want to find a function that satisfies the following Function pass through all the points ..that sounds to me as Catmull-Rom spline.. https://en.wikipedia.org/wiki/Catmull-Rom_spline https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline 11 minutes ago, MechanicalEngineer said: how do I find a fitting function for these? I can easily spot that this cannot be a logarithmic function (because slope is decreasing), nor can it be in the form ax^b unliss the power is b>1 (for same reason) Imagine we have two points instead of three. How to make equation which will approach 2nd point from 1st point? You need to have "time" parameter which goes from 0...1 The closer it is to 0, the more influence of 1st point and less 2nd point. The closer it is to 1, the more influence of 2nd point and less 1nd point. You end up with interpolation function i.e. x' = x_{0} * ( 1 - t ) + x_{1} * t y' = y_{0} * ( 1 - t ) + y_{1} * t After extending it to three or more points, you end up with something like Catmull-Rom spline. I think so it can be recursive: find middle point between 1st point and 2nd (x'=(x0+x1)/2,y'=(y0+y1)/2).. then add influence coming from 3rd point (whatever you like weight, when weight = 0 spline will be straight lines). Then repeat it i.e. treat newly created "middle" point as input to function calculating middle point. It would be easier for you to work it out inside of computer program which would generate 2d image in the real time. Edited May 2 by Sensei 0 Share this post Link to post Share on other sites

studiot 1729 Posted May 2 2 hours ago, MechanicalEngineer said: _{we can think of any number of points as an example.} _{so, lets say: point p1 = (6.5 ,1) p2 = (7.0, 2) p3=(7.48, 3)} You have quoted 3D coordinates so the function f(p_{n}) will be a surface or even a hypersurface, depending upon your intention,, unless you actually meant something different. So the question of 'strictly increasing becomes more difficult as it depends upon the direction you approach the point from. Can you clarify whether your function is F = f(x1,x2,x3) or does one of the x values represent a dependent variable? 0 Share this post Link to post Share on other sites

Sensei 899 Posted May 2 (edited) 4 minutes ago, studiot said: You have quoted 3D coordinates so the function f(p_{n}) will be a surface or even a hypersurface, depending upon your intention,, unless you actually meant something different. Imagine line/curve in 3D space. It's still line.. no surface.. BTW, he used two coordinates with decimal point with zero after digit i.e. 7.0 not 7, 0, 2 Edited May 2 by Sensei 0 Share this post Link to post Share on other sites

studiot 1729 Posted May 2 (edited) 28 minutes ago, Sensei said: 31 minutes ago, studiot said: Imagine line/curve in 3D space. It's still line.. no surface.. There is no single equation of a line in 3D. Here is an example of the 3 equations you require for a straight line. https://brilliant.org/wiki/3d-coordinate-geometry-equation-of-a-line/ Edited May 2 by studiot 0 Share this post Link to post Share on other sites