java 怎么画一个曲线?

cxxlp 2009-02-04 04:01:20
加精
java 怎么画一个曲线?
...全文
2845 92 打赏 收藏 转发到动态 举报
写回复
用AI写文章
92 条回复
切换为时间正序
请发表友善的回复…
发表回复
xclovexc666 2010-08-15
  • 打赏
  • 举报
回复
不就是graphics2D 想画什么画什么
You_Best 2010-07-10
  • 打赏
  • 举报
回复
学习ing
asd5517129 2010-04-06
  • 打赏
  • 举报
回复
学习啦
liwen19840617 2010-04-06
  • 打赏
  • 举报
回复
学习了~~~
宅男小何 2010-04-04
  • 打赏
  • 举报
回复
最简单的就打点了,呵呵!
wsbd10086 2009-03-04
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 waq12 的回复:]
楼上用字符绘图答非所问,真无聊
[/Quote]
你也傻的可以了。。。

回答楼主了,曲线在计算机中是由无数条直线构成的,直线越短曲线越细腻
wsbd10086 2009-03-04
  • 打赏
  • 举报
回复
你也傻的可以了。。。
Cactus_hxk 2009-03-04
  • 打赏
  • 举报
回复
真不错
漂亮
豆虫 2009-03-04
  • 打赏
  • 举报
回复
3楼 PERFECT!!!
istry 2009-03-04
  • 打赏
  • 举报
回复
[Quote=引用 21 楼 YidingHe 的回复:]
贝塞尔曲线的算法代码:
http://www.math.ucla.edu/~baker/java/hoefer/Beziersrc.htm

我是不懂。
[/Quote]

这个应该才是正解。

如果使用画点的方法,画sin cos还行。
如果画tan和ctg,就会在PI/2的左右有明显的断点。

g0tazu 2009-03-01
  • 打赏
  • 举报
回复
学习了
yy00915132 2009-02-28
  • 打赏
  • 举报
回复
mark
行舟 2009-02-28
  • 打赏
  • 举报
回复
牛B!顶下!copy下来学习!
longxie223 2009-02-28
  • 打赏
  • 举报
回复
楼上的各位大大。画图的值能不能随机和定义?
longxie223 2009-02-28
  • 打赏
  • 举报
回复
楼上的各位大大。画图的值能不能随机和定义?
happyshixiaojin 2009-02-23
  • 打赏
  • 举报
回复
学习
lbiah2004 2009-02-23
  • 打赏
  • 举报
回复
顶,好东西啊
bitghh 2009-02-21
  • 打赏
  • 举报
回复
学习了!!
csdn好地方,就是拿分比较辛苦~~
happymin2008 2009-02-21
  • 打赏
  • 举报
回复
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class Polylines extends Applet {
private static Color[] colors = {
Color.white, Color.black, Color.blue, Color.red,
Color.yellow, Color.orange, Color.cyan, Color.pink,
Color.magenta, Color.green };

public void init() {
Button button = new Button("repaint");
add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Polylines.this.repaint();
}
});
}
public void paint(Graphics g) {
int arraySize = ((int)(Math.random()*100));
int[] xPoints = new int[arraySize];
int[] yPoints = new int[arraySize];

for(int i=0; i < xPoints.length; ++i) {
xPoints[i] = ((int)(Math.random()*200));
yPoints[i] = ((int)(Math.random()*200));
}
g.setColor(colors[(int)(Math.random()*10)]);
g.drawPolyline(xPoints, yPoints, xPoints.length);
showStatus(arraySize + " points");
}

}
aaa6397197 2009-02-20
  • 打赏
  • 举报
回复
学习了!
加载更多回复(69)

62,612

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧