1

I am trying to write a program in Python to draw the bisectors between two points in L1 and L∞ metric. Please find more information about the metrics here. If (x1,y1) and (x2,y2) are the two points, then I feel the equation of the bisector in L1 metric should be:

|x-x1|+|y-y1| = |x-x2| + |y-y2|

In the L∞, I feel the equation should be:

max(|x-x1|,|y-y1|) = max(|x-x2|,|y-y2|)

If absolute values were not part of the equation, I would have simplified it to a form y=ax+b and plotted the values of (x,y) over a range of x. Can you please guide me in transforming this into code?

gaganso
  • 2,914
  • 2
  • 26
  • 43
  • 1
    Have you explored the problem a bit by drawing with paper and pencil? – Arndt Jonasson Apr 13 '18 at 06:25
  • Yes, I have. Some examples are also available [here](http://yaroslavvb.com/papers/tan-voronoi.pdf). It felt unintuitive initially since I am used to Euclidean but with a graph sheet, it didn't seem difficult. My main concern is converting the abs(y-y1) and abs(y-y2) to get an equation in terms of y. – gaganso Apr 14 '18 at 16:37
  • In some cases, there are many y values corresponding to one x value. – Arndt Jonasson Apr 14 '18 at 17:13
  • That's correct. It could be the other way round too since bisectors are polygonal chains and not just straight lines anymore. – gaganso Apr 15 '18 at 02:30
  • Yes, but only the first case prevents you from plotting y as a function of x. – Arndt Jonasson Apr 16 '18 at 09:13
  • Yes, that's correct. Thank you. Any hint/pointers at proceeding further? – gaganso Apr 16 '18 at 20:11
  • At this point, I don't know what the problem is. You know enough to implement something. – Arndt Jonasson Apr 16 '18 at 20:14

0 Answers0