[Custom Functions] Linear Interpolation

[Custom Functions] Linear Interpolation - Poruke

#1 Objavljeno: 4. 7. 2019. 17:18:01
overlord

overlord

601 svidjanja u 1.382 postova.

Grupa: Moderator

First of all I don't know if this method is supported, it would be very useful if not.
So if this is not a feature please forgive me because I considered as a bug.
The "InterBilinear" function gives wrong results if matrix is used for x or y value.

interpolation.sm (15,61 KiB) preuzeto 1536 put(ova).

Regards

interpolation.png
1 korisnika je svidelo ovu objavu
Davide Carpi 5. 7. 2019. 04:41:00
#2 Objavljeno: 5. 7. 2019. 00:34:26
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

First of all I don't know if this method is supported, it would be very useful if not.
So if this is not a feature please forgive me because I considered as a bug.
The "InterBilinear" function gives wrong results if matrix is used for x or y value.


Mathcad Bicubic can't be reproduced, even "if it could be"
would be useless whereas Smath does not have Matrix 3D plot [only 3 cols].
Your metric X,Y directions aren't correct. You can metric like center as well.
You can have surface plot, only... rotate the plot at will.

interpolation [Oterwise metric X, Y Directions].sm (33,32 KiB) preuzeto 1354 put(ova).

#3 Objavljeno: 5. 7. 2019. 01:19:17
Alvaro

Alvaro

1.139 svidjanja u 1.805 postova.

Grupa: User

Hi overlord. I prefer source code in a high level language, even it could be slowest.
interpolation bilinear source code.sm (26,59 KiB) preuzeto 1523 put(ova).
Best regards.
Alvaro.
#4 Objavljeno: 5. 7. 2019. 01:41:17
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

You can have surface plot, only... rotate the plot at will.


You can have it otherwise from the X_Y surface plot.

interpolation [Oterwise metric X, Y Directions].sm (95,7 KiB) preuzeto 1368 put(ova).
#5 Objavljeno: 5. 7. 2019. 03:16:06
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

You can have it otherwise from the X_Y surface plot.


... you can create the matrix and the X, Y directions at will.
Then just interpolate ... Spline linterp has the virtue equivalent quadratic.
It would be mistake to cspline.

Cheers ... Jean

Bilinear SplineInterp [Construct USER].sm (12,86 KiB) preuzeto 1286 put(ova).

#6 Objavljeno: 5. 7. 2019. 04:39:22
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

It is a bug, thank you! 4th and 5th argument type isn't checked, therefore (unintentionally) vector math applies.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Objavljeno: 5. 7. 2019. 09:15:23
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

First of all I don't know if this method is supported, it would be very useful if not.
So if this is not a feature please forgive me because I considered as a bug.
The "InterBilinear" function gives wrong results if matrix is used for x or y value.


Two things here:
1. The 4th and 5th arguments are presented in reverse order compared to Mathcad
2. The two dimension spline coding is from unknown source
...neither from either Smath [linterp, cinterp, ainterp]
...could be from erroneous quadratic source code.
As given in the attached: Spline(x,y,M) assumed = Mathcad Bicubic2D(x,y,M,vx,object)
At this point, you can spline/plot/rotate the surface as suggested before

Cheers ... Jean

Bilinear SplineInterp [Construct USER].sm (24,61 KiB) preuzeto 1318 put(ova).
#8 Objavljeno: 5. 7. 2019. 13:31:12
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

Two things here:


InterpBilinear(vx,vy,M,object,vector) ... does not collect"vector wise"
InterpBilinear(vx,vy,M,object,valueX) ... correct
That is the answer to the "bug",
InterpBilinear(vx,vy,M,object,vector)

  • Novi postovi
  • Nema novih postova