- import java.applet.*;
- import java.awt.*;
- public class K3 extends Applet {
- public void paint(Graphics g) {
- double t=10.0, samm=0.0125, x, y;
- int h = 0;
- while (t > -10.0)
- {
- t = t-samm;
- samm = samm * 1.01;
- h++;
- }
- int [] mx, my;
- mx = new int[h];
- my = new int[h];
- t = 10.0;
- samm = 0.0125;
- for(int j = 0; j < h; j++) {
- x = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.cos(t * Math.PI / 10.0) + 100;
- y = 100.0 * Math.sin(t * Math.PI / 2.0) * Math.sin(t * Math.PI / 10.0) + 100;
- t = t-samm;
- samm = samm * 1.01;
- mx[j] = new Integer((int)x);
- my[j] = new Integer((int)y);
- }
- for (int j = 0; j < h; j++) {
- System.out.print(mx[j] + ", ");
- }
- System.out.println(h);
- g.setColor(Color.red);
- g.drawPolygon(mx, my, h);
- }
- }
Posted by magel on Mon 22nd Jan 01:20
download | new post
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.