Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 1000;
- pts = {#[[1]] Cos[#[[2]]], #[[1]] Sin[#[[2]]]} & /@
- Transpose[{RandomReal[{4, 6}, n], RandomReal[{0, 2 Pi}, n]}];
- Needs["ComputationalGeometry`"]
- out = ConvexHull[pts];
- q = -3 Pi/4; (*Direction*)
- dq = Pi/10; (*Span*)
- pts1 = Select[pts[[out]], q - dq < ArcTan @@ # < q + dq &];
- Graphics[{LightBlue, Disk[{0, 0}, 6, {q - dq, q + dq}],
- PointSize[Large], Green, Point[pts1],
- PointSize[Small], Black, Point[pts],
- Dashed, Red, Circle[{0, 0}, 4], Circle[{0, 0}, 6]}]
- n2 = 40;
- in = Sort[pts, Norm[#1] < Norm[#2] &][[1 ;; n2]];
- pts2 = Select[in, q - dq < ArcTan @@ # < q + dq &];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement