Cstrike
2010-12-04 22:09:27
I want to create code where I'm able to generate a TPA from X points (realistic amount of points), but I don't know how to go about doing this.
For example:
For example, NumberOfTPoints would return this:
4:

8:
Image broken
One way I was thinking of it was dividing 2*pi radians by NumberOfTPoints, doing some trigonometry to find out:

Use sine/cosine laws to get the x/y changed, then apply that to the center point.
Is there an easier way to do this? Are there any functions we have that will do this for me?
For example:
TPAFromCircle (Radius, NumberOfTPoints: Integer; Center: TPoint): TPointArray;For example, NumberOfTPoints would return this:
4:

8:
Image broken
One way I was thinking of it was dividing 2*pi radians by NumberOfTPoints, doing some trigonometry to find out:

Use sine/cosine laws to get the x/y changed, then apply that to the center point.
Is there an easier way to do this? Are there any functions we have that will do this for me?