題目:
解題步驟:
關于其中部分方程式的作圖:
這兩張圖用了幾何畫板軟件撑帖,用來求題目中y=e^(-x)sin(x)以及r(x)的圖形(其中栏饮,在解題過程中,r(x)為y的積分)磷仰。
之后嘗試用processing對題目中的部分函數(shù)發(fā)散思維作圖袍嬉。,其中x隨時間變化灶平,控制圓形的半徑預填充顏色伺通,圓心隨鼠標的運動而運動。
這里只用了一個sin(x)的函數(shù)做了一個小例子之后正式的作業(yè)中逢享,會舉出更多例子罐监。
void setup(){
??size(1000,750);
?background(255);
}
float t=0;
void draw(){
??float x;
??++t;
??x=10*sin(t);
??circle(mouseX,mouseY,x*2);
??fill(100*x);
??box(x*25);
??translate(-x,t);
}
processing的效果圖:
以t的sin函數(shù)相關為x軸,t為y軸瞒爬。
void setup(){
? size(1000,750);
background(255);
}
float t=0;
void draw(){
? float x;
? ++t;
? x=10*sin(t);
? circle(x*100,t,x*2);
? fill(100*x);
? box(x*25);
? translate(x,t);
}
以t的sin函數(shù)相關為x軸弓柱,t的cos函數(shù)相關為y軸。當circle(x*50,y*50,x*2)中侧但,x矢空、y互換時,圓形以原函數(shù)的逆時針方向繪畫禀横。
void setup(){
? size(1000,750);
background(255);
}
float t=0;
void draw(){
? float x,y;
? ++t;
? x=10*sin(t);
? y=10*cos(t);
? circle(x*50,y*50,x*2);
? fill(100*x);
? box(x*25);
? translate(x,t);
}
同時以t的sin函數(shù)相關為x軸屁药、y軸。當circle(x*50,x*50,x*2)中柏锄,將x換為y時酿箭,以x軸形成軸對稱。
void setup(){
? size(1000,750);
background(255);
}
float t=0;
void draw(){
? float x,y;
? ++t;
? x=10*sin(t);
? y=10*cos(t);
? circle(x*50,x*50,x*2);
? fill(100*x);
? box(x*25);
? translate(x,t);
}
以t的tan函數(shù)相關為x軸趾娃,t為y軸缭嫡。
void setup(){
? size(1000,750);
background(255);
}
float t=0;
void draw(){
? float x;
? ++t;
? x=tan(t);
? circle(x*100,t,x*2);
? fill(100*x);
? box(x*25);
? translate(x,t);
}
同時以t的tan函數(shù)相關為x軸、y軸抬闷。
void setup(){
? size(1000,750);
background(255);
}
float t=0;
void draw(){
? float x;
? ++t;
? x=tan(t);
? circle(x*100,x*100,x*2);
? fill(100*x);
? box(x*25);
? translate(x,t);
}