macintosh_cookbook/examples/angle.pas
2020-05-07 18:47:11 +09:00

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.