一个简单的一箭穿心程序    其实这个程序也不难,只要专心形线方程(1-ρ×cosθ)来绘图就可以了。    作者:张跃华             学校:云南农业大学程序如下:#includegraphics.h
  #includemath.h#define FNX(x1) (int)(x+(x1)*sl)
  #define FNY(y1) (int)(MAXY-(y+(y1)*sl))
  #define R(theta) 1-pow(cos(1*theta),1)int sl=50,MAXY;
  float x1,y1,xs,ys,r,theta;
  /*画心*/
  void draw(int x,int y)
  {
   for(theta=0;theta2*3.14;theta+=0.01)
   {r=R(theta);
    x1=r*sin(theta);y1=r*cos(theta);
    xs=FNX(x1);ys=FNY(y1);
    if(theta==0)moveto(xs,ys);else lineto...[ 查看全文 ]