0
$\begingroup$

I am currently graphing balls under a certain metric space. For instance, a ball $B_M(0;1)$ with $M=\mathbb{R}^2$ and the Euclidean metric yields a circle centered at $(0,0)$ with radius $1$.

The corresponding code is:

d[x_List, y_List]:=Norm[x-y];
x0={0,0};
r=1;
RegionPlot[d[x0,{y_1,y_2}]<r,{y1,-2,2},{y2,-2,2}]

However, for the case that my metric becomes $d({\bf x,y})=\mbox{max}\ _{1\leq i\leq n}{|x_i-y_i|}$, I have no idea how to plot it. Can you help me by providing the code? Thanks in advance.

$\endgroup$
  • 1
    $\begingroup$ d[x_List, y_List] := Max[Abs[x - y]]; x0 = {0, 0}; r = 1; RegionPlot[d[x0, {y1, y2}] < r, {y1, -2, 2}, {y2, -2, 2}] $\endgroup$ – ulvi Apr 17 '18 at 0:24
  • $\begingroup$ Thank you @ulvi the code worked. $\endgroup$ – Jr Antalan Apr 17 '18 at 2:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.