IB AI · 14B Voronoi Diagrams
A new site takes the points that are closer to it than to the old sites. Compare the squared distances at the point you care about. The new edge is the perpendicular bisector of the new site and a neighbor.
Closer
If the new site is closer, the point changes cell.
Still closer to the old site
The point stays.
Equal
The point is on the new edge.
The edge
That edge is the perpendicular bisector of the new site and the neighbor.
Does the point stay?
Compare the squared distance to A with the squared distance to B.
to A: 2
to B: 26
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Compare the squared distance to A with the squared distance to B.
to A: 26
to B: 2
B is closer, so the point moves into B’s cell.
Answer: No. It moves to B.
Compare the squared distance to A with the squared distance to B.
to A: 2
to B: 26
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Compare the squared distance to A with the squared distance to B.
to A: 2
to B: 26
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Compare the squared distance to A with the squared distance to B.
to A: 1
to B: 25
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Compare the squared distance to A with the squared distance to B.
to A: 1
to B: 45
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
The new boundary.
The boundary is the perpendicular bisector.
midpoint = (4, 3)
slope of the segment = 5 − 16 − 2 = 1
perpendicular slope = −1
y − 3 = −1(x − 4)
y = −x + 7
Answer: y = −x + 7
The boundary is the perpendicular bisector.
midpoint = (3, 1)
slope of the segment = 2 − 06 − 0 = 13
perpendicular slope = −3
y − 1 = −3(x − 3)
y = −3x + 10
Answer: y = −3x + 10
The boundary is the perpendicular bisector.
midpoint = (3, 2)
slope of the segment = 0 − 45 − 1 = −1
perpendicular slope = 1
y − 2 = 1(x − 3)
y = x − 1
Answer: y = x − 1
Compare the squared distance to A with the squared distance to B.
to A: 5
to B: 5
The distances match, so the point is on the new edge.
Answer: On the edge between A and B.
Compare the squared distance to A with the squared distance to B.
to A: 9
to B: 9
The distances match, so the point is on the new edge.
Answer: On the edge between A and B.
Compare the squared distance to A with the squared distance to B.
to A: 8
to B: 8
The distances match, so the point is on the new edge.
Answer: On the edge between A and B.
A tie, or a point that stays.
Compare the squared distance to A with the squared distance to B.
to A: 13
to B: 13
The distances match, so the point is on the new edge.
Answer: On the edge between A and B.
Compare the squared distance to A with the squared distance to B.
to A: 13
to B: 13
The distances match, so the point is on the new edge.
Answer: On the edge between A and B.
Compare the squared distance to A with the squared distance to B.
to A: 1
to B: 25
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Compare the squared distance to A with the squared distance to B.
to A: 5
to B: 17
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
The boundary is the perpendicular bisector.
midpoint = (6, 4)
slope of the segment = 7 − 18 − 4 = 32
perpendicular slope = −23
y − 4 = −23(x − 6)
y = −23x + 8
Answer: y = −23x + 8
Compare the squared distance to A with the squared distance to B.
to A: 1
to B: 29
A is still closer, so the point stays in A’s cell.
Answer: Yes. It stays with A.
Want to go over a Voronoi diagram together?
Book a Session with Amy