n3ss3s
2007-11-03 09:09:28
This is nothing big, but even more useful.
Having troubles with remembering all the 'Round(Radius * Sine(x)) + MidPointX' Etc?
Heres the answer for your problems:
MidX, MidY - Coords of the midpoint
Radius - Distance between the midpoint and the point you wanna get
Angle - angle to get the point of.
Also, that does not need SRL, I wanted to find out the 'real' way…
Free to use, though crediting is nice even this isnt anything big..
Having troubles with remembering all the 'Round(Radius * Sine(x)) + MidPointX' Etc?
Heres the answer for your problems:
Function PointOnCircle(MidX, MidY, Radius, Angle: Integer): TPoint;
Begin
Result.x := MidX + Round(Radius * Cos(Radians(Angle - 90)));
Result.y := MidY + Round(Radius * Sin(Radians(Angle - 90)));
End;
MidX, MidY - Coords of the midpoint
Radius - Distance between the midpoint and the point you wanna get
Angle - angle to get the point of.
Also, that does not need SRL, I wanted to find out the 'real' way…
Free to use, though crediting is nice even this isnt anything big..