I want to sample random points between $Cos(x)$ and $Sin(x)$ on $0 \le x\le \frac \pi4$
I was able to do graph the function here in Mathematica. I would like to count, and then plot points between those two functions. I have tried the following, however, with no luck.
counter[n_] := (hitsCount = 0; hitsPoints = {};
Do[{x, y} = {RandomReal[{0, Pi/4}], RandomReal[{0, 1}]};
If[Sin[x] <= y <= Cos[x],
hitsCount = hitsCount + 1;
hits = AppendTo[hitsPoints, {x, y}]], {i, 1, n}];)
counter[10000]
ListPlot[hitsPoints, AspectRatio -> Automatic]
However, instead of a large sample of points of that "pizza" looking shape between Cos(x) and Sin(x), I get a blank plot. Is there an issue with my code?
region = DiscretizeRegion@ImplicitRegion[0 <= x <= Pi/4 && Sin[x] <= y <= Cos[x], {x, y}]
. $\endgroup$