資源簡(jiǎn)介
用C 模擬圓弧插補(bǔ)(圖形) http://blog.csdn.net/z893345329/article/details/25922857
代碼片段和文件信息
#include?
#include?
#include
using?namespace?std;
void?main(){
int?x0y0xeyexi=0yi=0xyFei=1shunrr=NULL;//rr為半徑的平方
int?a1a2b1b2;
cout<<“######################“< cout<<“#歡迎來(lái)到圓弧插補(bǔ)程序#“< cout<<“######################“< do{
cout<<“請(qǐng)輸入起點(diǎn)坐標(biāo):“< cin>>x0>>y0;
cout<<“請(qǐng)輸入終點(diǎn)坐標(biāo):“< cin>>xe>>ye;
cout<<“請(qǐng)輸入圓心坐標(biāo):“< cin>>x>>y;
if((xe-x)*(xe-x)+(ye-y)*(ye-y)==(x0-x)*(x0-x)+(y0-y)*(y0-y))
rr=(xe-x)*(xe-x)+(ye-y)*(ye-y);
else?cout<<“您輸入的坐標(biāo)夠不成圓弧!“<
} while(rr==NULL);
do{
cout<<“選擇圓弧方向:1、順時(shí)針;2、逆時(shí)針“< cin>>shun;
}while(shun!=1&&shun!=2);
cout<
/* x0
評(píng)論
共有 條評(píng)論