import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
public class Descartes extends Applet {
int AppletWidth, AppletHeight;
Image OffScreen;
Graphics drawOffScreen;
public void init() {
setBackground(Color.black);
AppletWidth = getSize().width;
AppletHeight = getSize().height;
OffScreen = createImage(AppletWidth, AppletHeight);
drawOffScreen = OffScreen.getGraphics();
}
public void paint(Graphics g) {
drawOffScreen.clearRect(0, 0, AppletWidth, AppletHeight);
drawOffScreen.setColor(Color.white);
int i, j;
double x, y, r;
for (i = 0; i <= 90; i++) {
for (j = 0; j <= 90; j++) {
r = Math.PI / 45 * i * (1 - Math.sin(Math.PI / 45 * j)) * 18;
x = r * Math.cos(Math.PI / 45 * j) * Math.sin(Math.PI / 45 * i)
+ AppletWidth / 2;
y = -r * Math.sin(Math.PI / 45 * j) + AppletHeight / 4;
drawOffScreen.fillOval((int) x, (int) y, 2, 2);
}
g.drawImage(OffScreen, 0, 0, this);
}
}
}
老师帮我家技术分啊,好不容易等到周末,为了进军黑马又通宵了一个晚上,也在论坛上回了不少帖子,明天又开始上班了,平时时间忙啊,没有大量时间泡在论坛上,只有等到下班周末废寝忘食来倪补,今天看到了你传到帖子上的学校周边图片,哎,我的心是彻底被挖走了,想进黑马刻不容缓啊。。。 |
|