3

I had a hard time finding a good title for this. Feel free to edit it if you find something more appropiate.

What I'm trying to do is finding a function such that, given a point $C$ (center), gives the square-wise distance from any point to $C$.

Now, for a simple definition of square-wise dist, imagine a square of a fixed size centered at $C$ and aligned to the $x$ and $y$ axis. I want each point of this square to be at the same square-wise distance from $C$, so it's the same as euclidean distance but changing circle by square.

How would I go into computing that? I can't wrap my head around it...

Ivo Terek
  • 77,665
Setzer22
  • 237

2 Answers2

3

If $C = (x_c, y_c)$, and $P = (x,y)$, then: $$d(P,C) = \sup\{|x_c - x|, |y_c - y|\}$$ does the job.

Ivo Terek
  • 77,665
  • sorry, what's sup? I assume it's the supreme of the set (idk if that's english) i.e. max, right? – Setzer22 Aug 11 '14 at 11:46
  • That's right (: – Ivo Terek Aug 11 '14 at 11:47
  • Nice, thanks! Then that does the job. I just came to that thinking: Well, if the point lies whithin a square's perimeter the largest of the x and y coordinates must be the side of the square. Then I saw your answer, so it makes sense. – Setzer22 Aug 11 '14 at 11:50
2

You may like the following :

$$|(x-a)-(y-b)|+|(x-a)+(y-b)|=A$$ represents a square whose edge length is $A$ with the center $(a,b)$.

For example, see here.

mathlove
  • 139,939