资源简介
这是个用java写的正弦函数,希望对一些朋友可以有帮助哦
代码片段和文件信息
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.Timer;
public class SinWave extends Jframe{
private static final int NUM = 1000;
private static final double TWOPI = 2 * 3.14;
private static final int STEP = 10;
private int []xPoints = new int[NUM];
private int []yPoints = new int[NUM];
private int []yCopyPoints = new int[STEP];
private int widthheight;
private Timer timer;
public SinWave()
{
super(“正弦曲线“);
setSize(500400);
this.setBackground(Color.white);
Dimension scrSize=Toolkit.getDefaultToolkit().getScreenSize();
width = getWidth();
height = getHeight();
this.setLocation((scrSize.width-width)/2(scrSize.height-height)/2);
for(int i = 0; i < NUM; i++)
{
xPoints[i] = i * width / NUM;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 894 2008-11-20 18:08 SinWave\SinWave$1.class
文件 1032 2008-11-20 18:08 SinWave\SinWave$2.class
文件 2848 2008-11-20 18:08 SinWave\SinWave.class
文件 1913 2008-11-19 19:34 SinWave\SinWave.java
目录 0 2008-12-01 20:13 SinWave
----------- --------- ---------- ----- ----
6687 5
评论
共有 条评论