Skip to content

Instantly share code, notes, and snippets.

@morganwilde
Created March 9, 2014 16:27
Show Gist options
  • Save morganwilde/9450305 to your computer and use it in GitHub Desktop.
Save morganwilde/9450305 to your computer and use it in GitHub Desktop.
program Bevarde;
type Taskas3D = record
X:real;
Y:real;
Z:real;
end;
type atkarpa = record
Taskas1: ^Taskas3D;
Taskas2: ^Taskas3D;
end;
type t=^Taskas3D;
type a=^atkarpa;
function atk(t1: t): a;
var s: a;
t2: t;
begin
New(t2);
New(s);
t2^.x:= -1 * (t1^.x);
t2^.y:= t1^.y;
t2^.z:= t1^.z;
s^.Taskas1:= t1;
s^.Taskas2:= t2;
atk:= s;
end;
var p: t;
s: a;
begin
New(p);
p^.x:= 1;
p^.y:= 2;
p^.z:= 3;
s:=atk(p);
writeln('Pradinio tasko koordinates: ', s^.Taskas1^.x:3:2, ' ', s^.Taskas1^.y:3:2, ' ', s^.Taskas1^.z:3:2);
writeln('Simetrisko tasko koordinates: ', s^.Taskas2^.x:3:2, ' ', s^.Taskas2^.y:3:2, ' ', s^.Taskas2^.z:3:2);
Dispose(p);
readln;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment