* Form1;
// ---------------------------------------- -----------------------------------
__fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{
}
// ---------------------------------------- -----------------------------------
/* перерахунок координат ланок */__fastcall TForm1 :: recalc (void)
{int i, j; sum_e_cos [100] = {0.0}, sum_e_sin [100] = {0.0}; sum_corner = 0.0; buf [256]; (i = 0; i
{_corner = 0.0; (j = 0; j <= i; j + +)
{sum_corner + = corner [j]; _e_cos [i] = Ei * cos (sum_corner * (PI/180.0)); _e_sin [i] = Ei * sin (sum_corner * (PI/180.0 )); (buf, "% .3 f", sum_e_cos [i]); (buf, "% f", & (sum_e_cos [i])); (buf, "% .3 f", sum_e_sin [ i]); (buf, "% f", & (sum_e_sin [i]));
} _x [i] = 0.0; _y [i] = 0.0; (j = 0; j <= i; j + +)
{link_x [i] + = sum_e_cos [j]; _y [i] + = sum_e_sin [j];
}
}
}
// ---------------------------------------- -----------------------------------
/* функція перевірки попадання ланки маніпулятора в перешкоду */__fastcall TForm1 :: barrier (int link)
{int status = 1, i; A1, B1, C1, A2, B2, C2, xx, i <12; i + +)
{status + +; status -;}
{= (C2 * B1-C1 * B2)/(A1 * B2-A2 * B1); = - ((A1 * xx + C1)/B1); = - ((A2 * xx + C2)/B2); ((lines [i] [4] == 0) && (xx == lines [i] [0]) &&
((yy> = lines [i] [1] && yy <= lines [i] [3]) | |
(yy> = lines [i] [3] && yy <= lines [i] [1])) &&
((yy> = link_y [link] && yy <= link_y [link +1]) | |
(yy> = link_y [link +1] && yy <= link_y [link]))
) {status = 0;} ((lines [i] [4] == 1) && (yy == lines [i] [1]) && p>
((xx> = lines [i] [0] && xx <= lines [i] [2]) | |
(xx> = lines [i] [2] && xx <= lines [i] [0])) &&
((xx> = link_x [link] && xx <= link_x [link +1]) | |
(xx> = link_x [link +1] && xx <= link_x [link]))
) {status = 0;}
}
} status;
}
// ---------------------------------------- -----------------------------------
/* промальовування ситуації */__fastcall TForm1 :: paint (void)
{int i, px, py; buf [256];
/* очистка полотна для малювання */-> Canvas-> Brush-> Color = clWhite; -> Canvas-> FillRect (Image1-> Canvas-> ClipRect) ;
<...