本人在国外,还有几个小时就交作业了。江湖救急啊。求大神解答这
processing吧
全部回复
仅看楼主
level 12
搴棠 楼主
原题:Plot a Lisajous curve where x = cos(15t) and y = sin(13t).
Try to do this first stepping t from 0 to 2*PI stepping 0.1 (too coarse) and then try finer gradations.
Look at the example of plotting a function if you have any questions about how to use translate and scale to set up your code.
翻译:绘制一个李萨如曲线 x=cos(15t) y=sin(13t).
尝试 第一步 改变t从0到2π 步进0.1(太粗糙) 然后尝试修改完美它。
2014年09月11日 22点09分 1
level 12
搴棠 楼主
2014年09月12日 00点09分 2
level 7
抱歉看到的晚了,程序如下,比较简单的参数曲线绘制程序:
float t = 0;
float dt = 0.1;
float s = 100; // size
void setup() {
size(500,500);
stroke(255);
}
void draw() {
background(0);
translate(250,250);
t = 0;
for(t=dt; t<2*PI; t+=dt){
line(s*cos(15*t), s*sin(13*t), s*cos(15*(t-dt)), s*sin(13*(t-dt)));
}
}
2014年09月12日 14点09分 3
经常看到你在贴吧帮助别人,我也想请教,方便给个qq联系方式吗?
2014年10月08日 12点10分
level 7
以后有问题的话尽量早点发布求助帖,不然不一定能及时看见
2014年09月12日 14点09分 4
太感谢了。万分感谢
2014年09月12日 16点09分
1