• Remix
  • Share
  • New Entry

on 10 Nov 2023
  • 17
  • 127
  • 0
  • 0
  • 421
drawframe(2);
theta = 1×48
-1.5708 -1.5267 -1.4826 -1.4384 -1.3943 -1.3502 -1.3061 -1.2620 -1.2179 -1.1738 -1.1296 -1.0855 -1.0414 -0.9973 -0.9532 -0.9091 -0.8649 -0.8208 -0.7767 -0.7326 -0.6885 -0.6444 -0.6002 -0.5561 -0.5120 -0.4679 -0.4238 -0.3797 -0.3355 -0.2914
Write your drawframe function below
function drawframe(f)
x = @(t) sin(3*t);
y = @(t) sin(2*t);
z = @(t) sin(2*t + pi/2);
t = 0:0.1:600;
X = x(t); Y = y(t); Z = z(t);
Rx = @(a) [1 0 0; 0 cos(a) -sin(a); 0 sin(a) cos(a)];
Ry = @(b) [cos(b) 0 sin(b); 0 1 0; -sin(b) 0 cos(b)];
Rz = @(g) [cos(g) -sin(g) 0; sin(g) cos(g) 0; 0 0 1];
Po = [X' Y' Z'];
Po = Po*Rz(pi/2);
figure('Position',[675 623 779 339]);
theta = linspace(-.5*pi,.16*pi,48)
P = Po*Ry(theta(f));
plot3(P(:,1),P(:,2),P(:,3),'.')
view(2)
axis off
end
Animation
Remix Tree