Search code examples
plotscilab

How to rotate plot along x-axis in Scilab?


Please can anyone tell me how to rotate it along the x-axis .

Rotate curve C1(u) about X-axis to generate the set of curves at a step size of pi/100 given by

theta=0:%pi/100:%pi/2.
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,:));

Solution

  • This will do the job:

    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,:));
    
    theta = %pi/100;
    R = [1 0 0
         0 cos(theta) -sin(theta) 
         0 sin(theta)  cos(theta)];
    
    for i=1:50
        C1 = R*C1;
        param3d(C1(1,:),C1(2,:),C1(3,:));
    end
    

    enter image description here