リサージュ図形

public void paint (Graphics g)
{
    double rd=(Math.PI)/180;
    double x,y;
    a=Integer.parseInt((choice1.getSelectedItem()));
    b=Integer.parseInt((choice2.getSelectedItem()));
    r=Integer.parseInt((choice3.getSelectedItem()));
    g.setColor(new Color(0,0,255));
    x=r*Math.sin(a*n*rd); //x座標
    y=r*Math.sin(b*n*rd); //y座標
    g.drawLine((int)x+200,(int)y+200,(int)x+200,(int)y+200); //点の描画
}


BACK >>