Skip to content

Instantly share code, notes, and snippets.

@jld
Created April 17, 2020 13:52
Show Gist options
  • Save jld/180747580ad633c93c97fe8f49831c43 to your computer and use it in GitHub Desktop.
Save jld/180747580ad633c93c97fe8f49831c43 to your computer and use it in GitHub Desktop.
Visualization of how not to “anonymize” location data
jitter[] :=
RandomReal[{500, 2500}]*
RotationTransform[RandomReal[{0, 2*Pi}]][{1, 0}]
Table[With[{points = Table[jitter[], 20]},
With[{annuli = Annulus[#, {500, 2500}] & /@ points},
Show[Graphics[{Opacity[0.05], annuli}],
Graphics[{Yellow, Point /@ points, Circle[{0, 0}, 500],
Circle[{0, 0}, 2500]}],
RegionPlot[RegionIntersection @@ Region /@ annuli,
PlotStyle -> Red], Axes -> True]]], 3, 5] // TableForm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment