MATLABで楕円を書く

楕円の座標は

\begin{align}
x&=a \cos \theta\\
y&=b \sin \theta
\end{align}

で計算できる。\(a=b\)の時、円になる。

a=2;
b=5;

theta=-2*pi:0.01:2*pi;

x=a*cos(theta);
y=b*sin(theta);

figure;
plot(x,y)
grid on

コメント

タイトルとURLをコピーしました