Question: Define a a function, jump _ on _ circle ( x , y , radius ) , that returns a tuple ( x _ circ,

Define a a function, jump_on_circle(x, y, radius), that returns a tuple (x_circ, y_circ) which is a random point on a circle of radius centred at (x, y). Python random module must be used to help make your random selection. Use random.uniform() to select an angle at random and then compute the corresponding coordinates (x_circ, y_circ).
>>> x =0.5; y =0.5; radius =0.5
>>> random.seed(17)
for i in range(3):
... print(jump_on_circle(x, y, radius))
...
(0.9952376754966548,0.5688450780279182)
(0.3256429837097586,0.9686145867025102)
(0.015324201812734362,0.6228387994549645)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!