I am trying to create a blue point (please see image below) within a small radius of a red point such that the blue point lies outside of the black circle.
The code thatIi have used to generate the figure is as follows:
With[{radius = 0.1},
Table[
initpoint = RandomPoint[Circle[]];
ℛ = RegionDifference[Circle[initpoint, radius], Disk[]];
p = RandomPoint[ℛ];
Show[
{Graphics[
{Black, Circle[],
Purple, Circle[initpoint, radius],
Blue, Point @ (p = RandomPoint[ℛ]),
Red, Point @ initpoint}]],
{10}]]
However, I am not interested in generating images. I am only interested in finding the position of the blue point given a red point and the radius. The code I use is the same as before except that i do not show graphics.
With[{radius = 0.001},
Table[
initpoint = RandomPoint[Circle[]];
ℛ = RegionDifference[Circle[initpoint, radius], Disk[]];
RandomPoint[ℛ],
{100}]] // AbsoluteTiming
(* {9.02254, {{-0.6495, -0.761656}, {-0.122595, -0.99263}, <<96>>,{-0.142981,
0.990732}, {0.86886, 0.49706}}} *)
The above shows that it is taking 9 seconds to generate 100 configurations of blue given red. The process is extremely slow. Is there a way to speed the code up or is there a better algorithm?
Would be grateful for help.