00001 #include <SyFi.h>
00002
00003
00004 int main() {
00005 Triangle t(lst(0,0), lst(1,0), lst(0,1));
00006 int order = 2;
00007 ex polynom;
00008 lst variables;
00009
00010
00011
00012 polynom = pol(order, 2, "b");
00013
00014 variables = coeffs(polynom);
00015
00016 ex Nj;
00017
00018 lst points = bezier_ordinates(t,order);
00019
00020
00021
00022
00023
00024 for (int j=1; j <= points.nops(); j++) {
00025 lst equations;
00026 int i=0;
00027 for (int i=1; i<= points.nops() ; i++ ) {
00028
00029 ex point = points.op(i-1);
00030
00031 ex eq = polynom == dirac(i,j);
00032
00033 equations.append(eq.subs(lst(x == point.op(0) , y == point.op(1))));
00034 }
00035
00036
00037
00038 ex subs = lsolve(equations, variables);
00039
00040 Nj = polynom.subs(subs);
00041 cout <<"Nj "<<Nj<<endl;
00042 }
00043
00044 }
00045
00046