0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

カッシーニ曲線CASSINIAN CURVE

Posted at

※この投稿はカッシーニの卵形線(Cassini Ovals)ではなく、カッシーニ曲線(CASSINIAN CURVE)について書いたものです。

カッシーニ曲線は、スーパー楕円以外で、丸い多角形を描くのに使えます。

末尾の参考サイトより、
極方程式では

r^{2n}-2a^nr^n\cos{n\theta}+a^{2n}=b^{2n}

つまり

e=\frac{b}{a}

のとき

r=a\sqrt{\cos{n\theta}\pm\sqrt{e^{2n}-\sin^2{n\theta}}}

デカルト座標系では、

(x^2+y^2)-2a^nRe((x+iy)^n)+a^{2n}-b^{2n}=0

※なお、カッシーニの卵形線の式は、

r^4-2a^2r^2\cos{2\theta}=b^4-a^4
(x^2+y^2)^2-2a^2(x^2-y^2)+a^4=b^4
((x-a)^2+y^2)((x+a)^2+y^2)=b^4

n=2, a=b=1のとき同一となると思う。

cassinianCurve.pde
size(800, 800);
background(255);
translate(400,400);
noFill();

float r,x,y,a=100,tmp;
float n = 3;
for(float e=1.0; e<=1.66; e+=0.06){
  beginShape();
    for(float th=0; th<=2*PI; th+=0.002){
      tmp = sqrt(pow(e,2*n)-pow(sin(n*th),2));
      r = a*sqrt(cos(n*th)+tmp);
      x = r*cos(th);
      y = r*sin(th);
      stroke(256*(2-e),0,255);
      curveVertex(x, y);
    }
  endShape();
}

n1_6.png

a=bかつn=3の場合、中心で交わる三葉線となる。

a<bの場合、丸いn角形のようになる。上図。
特に、曲線に凹みがなくなるのは、e=1.66ぐらい。

a>bの場合、下図のような卵形線になる。強引に点描で描いた。青い線は式中の符号がマイナスの部分。

size(800, 800);
background(255);
fill(0);
textSize(32);
text("n=3",50,50);

translate(400,400);
noFill();

float r,x,y,a=100;
float n = 3;
for(float e=0.4; e<=1.66; e+=0.06){
  beginShape(POINTS);
    for(float th=0; th<=2*PI; th+=0.00004){
      float tmp = sqrt(pow(e,2*n)-pow(sin(n*th),2));
      r = a*sqrt(cos(n*th)+tmp);
      x = r*cos(th);
      y = r*sin(th);
      stroke(256*(2-e),0,255);
      vertex(x, y);
      r = a*sqrt(cos(n*th)-tmp);
      x = r*cos(th);
      y = r*sin(th);
      stroke(0,0,255);
      vertex(x, y);
    }
  endShape();
}

a1_6.png

補足

三葉線trifoliumの式は、

r=a\sin3\theta
\begin{eqnarray}
  \left\{
    \begin{array}{l}
      x=a\sin3\theta\cos\theta \\
      y=a\sin\theta\sin3\theta
    \end{array}
  \right.
\end{eqnarray}

四葉線quadrifoliumの式は、

r=a\cos2\theta
\begin{eqnarray}
  \left\{
    \begin{array}{l}
      x=a\cos\theta\cos2\theta \\
      y=a\sin\theta\cos2\theta
    \end{array}
  \right.
\end{eqnarray}

チェビシェフ螺旋(丸い多角形が描ける)

r=n+\frac{1}{k}\cos{n\theta}

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?