size(300,300);

double iu,ou;

int obj=90;

double f=20;

int keisya=2;

double Kx,Ky;

int Kxi,Kyi;

double katamuki;

 

int i_l;

double i_iu, i_ou;

colorMode(RGB,256);

 

for(int i=0; i<5; i++){

   if(i==0)stroke(255,255,0);

   if(i==1)stroke(0,255,255);

   if(i==2)stroke(255,0,255);

   if(i==3)stroke(128,128,128);

   if(i==4)stroke(255,255,255);

   Kx= (i*5-10)/((double)(-(i*5-10))/(100-obj)+(i*5-10)/f);

   Ky=-((double)(i*5-10)/(100-obj))*Kx;

   Kxi=(int)Kx+100; Kyi=(int)Ky+100;

   point(Kxi,Kyi);

//   print( Kx); println(Ky);

   for(int j=0; j<11; j++){

    stroke(255,0,0);

    line(obj,(i*5-10)+100,100,((i*5-10)+100)+(j-5)*keisya);

   if(i==0)stroke(255,255,0);

   if(i==1)stroke(0,255,255);

   if(i==2)stroke(255,0,255);

   if(i==3)stroke(128,128,128);

   if(i==4)stroke(255,255,255);

     katamuki=((double)((i*5-10)+100+(j-5)*keisya)-Kyi)/(Kx);

     println(Kxi);

     println(Kyi);

     println((double)((i*5-10)+100)+(j-5)*keisya);

     println(Kx);

     println(Ky);

     println(katamuki);

     line(Kxi,Kyi,200,(int)(-katamuki*(100.0-Kx))+Kyi);

    if((((-katamuki*(100.0-Kx))+Kyi) <120)&& ((-katamuki*(100.0-Kx))+Kyi)>80){

      double e_l= (int)(-katamuki*(100.0-Kx))+Kyi;

      double e_iu= -katamuki;

      double e_ou= e_iu - ((e_l-100)/f);

     

      line(200, (int)(-katamuki*(100.0-Kx))+Kyi,300,(int)(e_l + e_ou*100));

//      print((-katamuki*(100.0-Kx))+Kyi));

//      print((100-katamuki*f));

 

     

    }

  } 

}

 

stroke(0,0,255);

line(100,0,100,200);

line(200,0,200,200);

stroke(0,255,0);

line(120,0,120,200);

line(220,0,220,200);

stroke(255,255,255);

line(0,100,300,100);

stroke(255,0,0);

point(120,100);