如何在 Scilab 中沿 x 轴旋转绘图?
How to rotate plot along x-axis in Scilab?
谁能告诉我如何沿 x 轴旋转它。
绕 X 轴旋转曲线 C1(u) 生成一组曲线,步长为 pi/100
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,:));
这将完成工作:
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
clc;clear;
theta=0:%pi/100:%pi/2;
n=length(theta);
for i=1:n
x=sin(theta(i));
y=cos(theta(i));
r=[1 0 0;0 y -x;0 x y];
ABCD = [0 0 1;1 1 1;1/4 1/2 1] \ [0 0 0;1 0 0;1/2 1/2 0];
ABC = ABCD*r';
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,:));
end
谁能告诉我如何沿 x 轴旋转它。
绕 X 轴旋转曲线 C1(u) 生成一组曲线,步长为 pi/100
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,:));
这将完成工作:
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
clc;clear;
theta=0:%pi/100:%pi/2;
n=length(theta);
for i=1:n
x=sin(theta(i));
y=cos(theta(i));
r=[1 0 0;0 y -x;0 x y];
ABCD = [0 0 1;1 1 1;1/4 1/2 1] \ [0 0 0;1 0 0;1/2 1/2 0];
ABC = ABCD*r';
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,:));
end