Can someone help me create code for a hippocrates moons on random shape with given amount of edges? I want to make something like this:
when you press button, it asks you for the amount of edges/points you want, then it adds given amount of point in random spots on a circle (R=constant) and draws shape from it. Each side of the shape has small circle on the middle with diameter of the same lenght as that side.
Heres what I managed to do so far: Triangle with adjustable sides lenght:
Button["show",
Print[Animate[
Show[Graphics[{Blue, Disk[{0, b/2`}, b/2`], Blue,
Disk[{a/2, 0}, a/2], RGBColor[1, 1, 1],
Disk[{a/2, b/2`}, Sqrt[a^2 + b^2]/2], RGBColor[0, 0, 0],
Circle[{a/2, b/2`}, Sqrt[a^2 + b^2]/2], Red,
Polygon[{{0, 0}, {a, 0}, {0, b}}], RGBColor[0, 0, 0],
Line[{{-b/2, b/2}, {0, b/2}}], Line[{{a/2, 0}, {a/2, -a/2}}],
Line[{{0, 0}, {a, 0}}], Line[{{0, 0}, {0, b}}],
Line[{{0, b}, {a, 0}}], Thick, Line[{{a/2, b/2}, {a, 0}}],
Line[{{a/2, b/2}, {a/2 + Sqrt[a^2 + b^2]/2, b/2}}]}, {Axes ->
True, AxesStyle -> Black}],
AxesLabel -> {HoldForm[x], HoldForm[y]},
PlotLabel -> HoldForm[Triangle], LabelStyle -> {Black},
Frame -> Automatic], {a, 1, 5, Appearance -> "Labeled"}, {b, 1,
5, Appearance -> "Labeled"}, AnimationRate -> 0.5,
AnimationRunning -> False]], Method -> "Queued"]
I want to do something like this but for random point placement and for given amount of points (program ask u how many points you want). Animate is not required here, just the image.
I only managed to put random points on circle and I am stuck. This is the code:
f[] := Block[{u, t, r}, u = Random[] + Random[];
t = Random[] 2 Pi;
r = 1;
{r Cos[t], r Sin[t]}]
a = Sort[Table[f[], {4}]]
ListPlot[a, AspectRatio -> Automatic]
Help please