mirror of
https://git.sr.ht/~rabbits/macintosh_cookbook
synced 2024-12-27 10:29:25 +00:00
26 lines
386 B
ObjectPascal
26 lines
386 B
ObjectPascal
program ExampleAngle;
|
|
|
|
var
|
|
ax, ay, bx, by, angle, length, t: Real;
|
|
|
|
begin
|
|
|
|
angle := 45;
|
|
length := 100;
|
|
|
|
ax := 50;
|
|
ay := 50;
|
|
|
|
t := angle * PI / 180;
|
|
bx := ax + length * cos(t);
|
|
by := ay + length * sin(t);
|
|
|
|
ShowDrawing;
|
|
{ origin }
|
|
MoveTo(round(ax), round(ay));
|
|
LineTo(round(ax + 100), round(ay));
|
|
{ offset }
|
|
MoveTo(round(ax), round(ay));
|
|
LineTo(round(bx), round(by));
|
|
|
|
end. |