-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSFERA.PAS
46 lines (39 loc) · 868 Bytes
/
SFERA.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
program sfera;
var
procedure pasukimas (var x, y, z : integer; xx, yy, zz : integer);
var
pg : record
x, y, z : integer;
end;
sinn, coss : real;
begin
if xx > 0 then
begin
sinn := sin (xx * pi / 180);
coss := cos (xx * pi / 180);
pg.y := trunc (y * coss - z * sinn);
pg.z := trunc (y * sinn + z * coss);
y := pg.y;
z := pg.z;
end;
if yy > 0 then
begin
sinn := sin (yy * pi / 180);
coss := cos (yy * pi / 180);
pg.x := trunc (x * coss + z * sinn);
pg.z := trunc (z * coss - x * sinn);
x := pg.x;
z := pg.z;
end;
if zz > 0 then
begin
sinn := sin (zz * pi / 180);
coss := cos (zz * pi / 180);
pg.x := trunc (x * coss - y * sinn);
pg.y := trunc (x * sinn + y * coss);
x := pg.x;
y := pg.y;
end;
end;
begin
end.