lign="justify"> R що будемо повертати}
Type Matrix = Array [1 .. 3,1 .. 3] Of Real; I, J: Byte;: Matrix; I: = 1 To 3 Do For J: = 1 To 3 Do If I = J Then O [I, J]: = 1O [I, J]: = 0;
[1,1]: = COS (Teta); [1,2]: = SIN (Teta); [2,1]: =-SIN (Teta); [2,2] : = COS (Teta);
. X: = O [1,1] * PX + O [1,2] * PY + O [1,3];. Y: = O [2,1] * PX + O [2,2] * PY + O [2,3];;
DrawTriangle; (LightGray); I: = 1 To N-1 Do Line (Trunc (A [I]. X), Trunc (A [I]. Y), Trunc (A [I +1]. X), Trunc (A [I +1]. Y)); (Trunc (A [N]. X), Trunc (A [N]. Y), Trunc (A [1]. X) , Trunc (A [1]. Y));;
HideTriangle; I: Byte; (Black); I: = 1 To N-1 Do Line (Trunc (A [I]. X), Trunc (A [I]. Y), Trunc (A [I +1]. X), Trunc (A [I +1]. Y)); (Trunc (A [N]. X), Trunc (A [N]. Y), Trunc (A [1 ]. X), Trunc (A [1]. Y));; Fig; [1]. X: = -40; A [1]. Y: = -25; [2]. X: = -40; A [2]. Y: = 25; [3]. X: = -30; A [3]. Y: = 25; [4]. X: = -30; A [4]. Y: = 0; [5]. X: = -15; A [5]. Y: = 25; [6]. X: = 0; A [6]. Y: = 0; [7]. X: = 0; A [ 7]. Y: = 25; [8]. X: = 10; A [8]. Y: = 25; [9]. X: = 10; A [9]. Y: = -25; [10] . X: = 20; A [10]. Y: = 0; [11]. X: = 10; A [11]. Y: = 25; [12]. X: = 20; A [12]. Y : = 25; [13]. X: = 25; A [13]. Y: = 10; [14]. X: = 30; A [14]. Y: = 25; [15]. X: = 40 ; A [15]. Y: = 25; [16]. X: = 30; A [16]. Y: = 0; [17]. X: = 40; A [17]. Y: = -25; [18]. X: = 30; A [18]. Y: = -25; [19]. X: = 25; A [19]. Y: = -10; [20]. X: = 20; A [20]. Y: = -25; [21]. X: = 0; A [21]. Y: = -25; [22]. X: = -15; A [22]. Y: = 0; [23]. X: = -30; A [23]. Y: = -25; [24]. X: = -40; A [24]. Y: = -25;;
;: = Detect; (grDriver, grMode, 'c: tp bgi ');
{I: = 1 To N Do Begin [I]. X: = Random (10) * 10 +100; [I]. Y: = Random (20) * 10 +100;;
};
. X: = 1.5; CY: = 1.5;: = Pi/24;: = 0.05; I: = 1 To N Do Begin (A [I], C, A [I]) ;;
NOT (Keypressed) Do Begin
. X: = Trunc (GetMaxX/2); LY: = Trunc (GetMaxY/2); I: = 1 To N Do Begin (A [I], U, A [I]) ; (A [I], L, A [I]);;
; Delay (400); HideTriangle;
. X: =-LX; LY: =-LY; I: = 1 To N Do Begin (A [I], L, A [I]);;;
;.
Додаток В
Uses Graph, Crt;
N = 8; = 12;
Coord = record, Y, Z: Real;;
= record, E, C: Word;;
: Integer;: Integer;: Array [1 .. N] of Coord;: Array [1 .. M] of Rebro;: Char;: Byte;, C: Coord;, Uy, Uz: Real;
Tr3d (P, T: Coord; Var R: Coord); Matrix = Array [1 .. 4,1 .. 4] Of Real; I, J: Byte;: Matrix; I: = 1 To 4 Do For J: = 1 To 4 Do If I = J Then O [I, J]: = 1O [I, J]: = 0;
[1,4]: = TX; [2,4]: = TY; [3,4]: ...