Circumference Points

Finding and plotting points on the circumference of a circle: This article explains how to write a simple function that provides cartesian co-ordinates for a point based on a circles centre co-ordinates, its radius, and the degree of rotation.

Finding a point on the circumference of a circle
can be a pleasantly easy affair. To find any point,
we will need the following information:

The co-ordinates of the centre of the circle (nXpos,nYpos)

The radius of the circle (nRadius), and

The offset of the point, in degrees of rotation (dDegrees)

First of all, we should check that the degrees of rotation
is in the range zero to 360, and reduce it by 90° to
allow for the fact that by default, zero degrees will fall
on the horizontal axis.

dDegrees = ( dDegrees - 90 ) % 360;

We can now easily find the x,y co-ordinates of the point
we want using sine and cosine: