plotcurvescilabparametric-equations

How to make plot a curve in Scilab?


Use param3d to plot a curve C1(u)=Au2+Bu+C, which passes through

(0,0,0) at u=0,
(1,0,0)at u=1, 
(1/2,1/2, 0) at u=0.5.

Have to use param3d .


Solution

  • Just write down the equations, using matrix block form you have

    |  0   0    1 |   | A |   | 0   0   0 |
    |  1   1    1 | * | B | = | 1   0   0 |
    |  1/4 1/2  1 |   | C |   | 1/2 1/2 0 |
    

    hence you just have to solve this equation for the [A;B;C] matrix then extract A,B,C and plot the curve

    ABC = [0 0 1;1 1 1;1/4 1/2 1] \ [0 0 0;1 0 0;1/2 1/2 0];
    A = ABC(1,:);
    B = ABC(2,:);
    C = ABC(3,:);
    u = linspace(0,1,100);
    C1 = A'*u.^2+B'*u+C'*ones(u);
    param3d(C1(1,:),C1(2,:),C1(3,:));
    

    It is easy to see in advance that C=(0,0,0) here, but the above method is general.

    enter image description here