Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline overlord  
#1 Posted : 04 July 2019 23:18:01(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
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 (16kb) downloaded 86 time(s).

Regards

interpolation.png
thanks 1 user thanked overlord for this useful post.
on 05/07/2019(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 05 July 2019 06:34:26(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
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 (34kb) downloaded 53 time(s).

Offline Razonar  
#3 Posted : 05 July 2019 07:19:17(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi overlord. I prefer source code in a high level language, even it could be slowest.
interpolation bilinear source code.sm (27kb) downloaded 57 time(s).
Best regards.
Alvaro.
Offline Jean Giraud  
#4 Posted : 05 July 2019 07:41:17(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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 (96kb) downloaded 48 time(s).
Offline Jean Giraud  
#5 Posted : 05 July 2019 09:16:06(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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 (13kb) downloaded 32 time(s).

Offline Davide Carpi  
#6 Posted : 05 July 2019 10:39:22(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
It is a bug, thank you! 4th and 5th argument type isn't checked, therefore (unintentionally) vector math applies.
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#7 Posted : 05 July 2019 15:15:23(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
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 (25kb) downloaded 45 time(s).
Offline Jean Giraud  
#8 Posted : 05 July 2019 19:31:12(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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)

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.