# How to generate a heat map in a Voronoi diagram?

I need to draw a heat map in a Voronoi diagram with 4-5 Voronoi cell. Each cell needs to have its own heat map. Each cell should have maximum signal strength at the centre and then the strength should get weaker.

For example, let us consider a cellular system with 4-5 base stations or towers. In general, the closer you are to the base station, the better signal you get. As you move away from the base station, the signal weakens (although this is not always true, as a user close to the base station may also have weak signal if he/she is obstructed by the house, building etc).

I would like to draw a smooth heat map based on this scenario. Let $P$=1 be the transmit power of a base station. The power decays with distance $d$ with rate $d^{-\eta}$ where $\eta=3$.

• Can you post some code to show what you've already tried and where it didn't work? Commented Aug 17, 2017 at 7:55
• What is the function that measures the "signal strength"? Not everybody is a specialist, so you might wish to elaborate a bit on what you're plotting. Commented Aug 17, 2017 at 7:59
• @J.M. I have edited my question. Commented Aug 17, 2017 at 8:47
• So your function is something like $$\sum_k \frac1{\|\mathbf x-\mathbf x_k\|^3}$$ for the $\mathbf x_k$ locations? Commented Aug 17, 2017 at 12:10

Is this what you had in mind?

stations = RandomReal[{-2, 2}, {5, 2}];

Clear[pow]
pow[point_List] := Total[1/Norm[point - #]^3 & /@ stations]

With[{range = 2.5},
{DensityPlot[Log10@pow[{x, y}], {x, -range, range}, {y, -range, range},
PlotPoints -> 50, Epilog -> {Red, PointSize[0.02], Point@stations}],
VoronoiMesh[stations, {{-1, 1} range, {-1, 1} range}, PlotTheme -> "Lines"]}
];

Show[%, Frame -> None]


Note that this is plotting the density of the logarithm of the power, rather than the power itself, because the latter is a very spikey function and would not be very easy to capture a reasonable range. If that's not what you want, remove the Log10@ portion.

• Very cool (+1). Commented Aug 17, 2017 at 16:59
• @MarcoB, Thank you very much. Is there a way to make the circles rough. I mean they are not perfectly round. Smoothly varying radius and that red points need to be at the centres of respective voronoi cells. And the blue region need to be small. That is each voronoi cell is largely covered by the base stations, only small (20-30%) areas have weaker signal power. Commented Aug 18, 2017 at 1:30
• @Dimitrios, shouldn't you 1. already have the mathematical model and reference for that (signal attenuation and everything); and 2. have included those additional assumptions in your question? Commented Aug 18, 2017 at 3:58