diff options
Diffstat (limited to '1332/CH12/EX12.2/12_2.sce')
-rwxr-xr-x | 1332/CH12/EX12.2/12_2.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/1332/CH12/EX12.2/12_2.sce b/1332/CH12/EX12.2/12_2.sce new file mode 100755 index 000000000..0f30446c9 --- /dev/null +++ b/1332/CH12/EX12.2/12_2.sce @@ -0,0 +1,20 @@ +//Example 12.2
+//Lagarangian Method
+//Page no. 373
+clc;close;clear;
+
+xk=[-1,0,2,5];
+yk=[10,7,7,22];
+
+P=0;
+x=poly(0,"x");
+for k=0:3
+ p=yk(k+1)
+ for j=0:3
+ if(j~=k)
+ p=p*((x-xk(j+1))/(xk(k+1)-xk(j+1)))
+ end
+ end
+ P=P+p;
+end
+disp(P,'P=')
\ No newline at end of file |