Jump to content

Recommended Posts

Posted (edited)

Hello,

 

lets say I have coordinates for 3 points, and I want to find a function that satisfies the following

  1. Function pass through all the points
  2. Function is strictly increasing
  3. 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 by MechanicalEngineer
Posted (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

  1. 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' = x0 * ( 1 - t ) + x1 * t

y' = y0 * ( 1 - t ) + y1 * 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 by Sensei
Posted
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(pn) 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?

Posted (edited)
4 minutes ago, studiot said:

You have quoted 3D coordinates so the function f(pn) 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..

Grab.thumb.png.da1a0f2fd8cda9a413736700e1054438.png

 

BTW, he used two coordinates with decimal point with zero after digit i.e. 7.0 not 7, 0, 2

 

Edited by Sensei

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.