Camel
2014-10-11 14:11:13
I present to you a completely useless procedure. Unless of course, you want to make your debug for whatever script look really cool.
So here you are, the product of me being bored.
This will draw a star based on a center point. The p and the q are explained here
And here is a picture of various inputs/outputs

So yeah, thats what a 69 pointed star looks like.
So here you are, the product of me being bored.
procedure StarPaint(point : TPoint; r, p, q : Integer; Color : TColor);
var
Radian : Extended;
Points : TPointArray;
i : Integer;
OverLap : Integer;
begin
SetLength(Points,p);
Radian := (2.0 * 3.14159) / p;
for i:=0 to High(Points) do
begin
Points[i].X := round( point.x - (sin(Radian*i) * r) );
Points[i].Y := round( point.y - (cos(Radian*i) * r));
end;
for i:=0 to High(Points) do
begin
if ( (i + q) < p ) then
OverLap := (i + q)
else
OverLap := (i + q) - p;
try
SmartImage.LineTo(Points[i],Points[OverLap], Color);
except
WriteLn('Tried to draw out of bounds');
break;
end;
end;
end; This will draw a star based on a center point. The p and the q are explained here
And here is a picture of various inputs/outputs

So yeah, thats what a 69 pointed star looks like.