Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw a point a set distance away from a base point

I'm trying to figure out an algorithm for finding a random point a set distance away from a base point. So for example:

alt text

This could just be basic maths and my brain not working yet (forgive me, haven't had my coffee yet :) ), but I've been trying to work this out on paper and I'm not getting anywhere.

like image 574
Niall Avatar asked Aug 05 '10 12:08

Niall


1 Answers

coordinate of point on circle with radius R and center (xc, yc):

x = xc + R*cos(a);
y = yc + R*sin(a);

changing value of angle a from 0 to 2*PI you can find any point on circumference.

like image 107
Vladimir Avatar answered Oct 01 '22 01:10

Vladimir