• Remix
  • Share
  • New Entry

  • Ze Chen

  • /
  • taylor approximate a circle

on 27 Nov 2023
  • 15
  • 14
  • 0
  • 0
  • 281
drawframe(1);
Write your drawframe function below
function drawframe(f)
syms g(x) x;
th = 0:0.02:2*pi;
g(x) = exp(x*1i);
hex = plot(real(g(th)), imag(g(th)), LineWidth=2);
hold on;
n = round(f/4)+1;
Ty = taylor(g,x,'Order',n);
plot(real(Ty(th)), imag(Ty(th)),'-r', LineWidth=2);
plot(real(Ty(th)), -imag(Ty(th)),'-r', LineWidth=2);
axis([-2, 2, -2, 2]);
axis square
hold off;
end
Animation
Remix Tree