Graph of Relation under Coordinate Transformation

rel={Function[{x,y},Abs[x]≤2&&Abs[y]≤2],Function[{x,y},x^2+y^2≤4],Function[{x,y},Abs[x]≤2&&Abs[y]≤2&&x+y≤0]};

Manipulate[Module[{XX,YY,xx,yy,Rel},Rel[x_,y_]:=rel[[gr]][a(x-b),c(y-d)];{XX,YY}=If[move==1,pp,{pp[[1]]/a,pp[[2]]/c}+{b,d}];{xx,yy}=If[move==2,pp,{a(pp[[1]]-b),c(pp[[2]]-d)}];Column[{Row[{Style["R",Italic],Style["("],Style["X",Italic],", ",Style["Y",Italic],Style[")="],Rel[XX,YY]}],Row[{Style["P",Italic],Style["("],Style["x",Italic],", ",Style["y",Italic],
Style[")="],rel[[gr]][xx,yy]}],

Graphics[{{Green,Switch[gr,1,Rectangle[{-2,-2},{2,2}],2,Disk[{0,0},2],3,Polygon[{{-2,2},{-2,-2},{2,-2}}]]},{RGBColor[0, 1, 1],Translate[Scale[Switch[gr,1,Rectangle[{-2,-2},{2,2}],2,Disk[{0,0},2],3,Polygon[{{-2,2},{-2,-2},{2,-2}}]],{1/a,1/c},{0,0}],{b,d}]},Arrow[{{b,d},{XX,YY}}],Arrow[{{0,0},{XX,YY}}],Arrow[{{0,0},{xx,yy}}],{PointSize[0.01],Point[{b,d}]},Text[Row[{Style["{",20],Style["X",20,Italic],", ",Style["Y",20,Italic],Style["}",20]}],{XX,YY},{0,-1}],Text[Row[{Style["{",20],Style["x",20,Italic],", ",Style["y",20,Italic],Style["}",20]}],{xx,yy},{0,-1}],Text[Row[{Style["{",20],Style["b",20,Italic],", ",Style["d",20,Italic],Style["}",20]}],{b,d},{0,1}]},PlotRange->{{-3,11},{-2.2,13}},ImageSize->{450,450},Axes->True]}]],Row[{"graph of relation ",Style["P",Italic]}],{{gr,1,""},{1->"square",2->"disk",3->"triangle"}},{{a,0.5,Style["a",Italic]},0.5,2,ImageSize->Tiny,Appearance->"Labeled"},{{b,4,Style["b",Italic]},0,5,ImageSize->Tiny,Appearance->"Labeled"},{{c,0.5,Style["c",Italic]},0.5,2,ImageSize->Tiny,Appearance->"Labeled",ImageSize->Tiny,Appearance->"Labeled"},{{d,6.4,Style["d",Italic]},0,8,ImageSize->Tiny,Appearance->"Labeled"},{{pp,{4,2}},ControlType->Locator,Appearance->""},"move:",{{move,1,""},{1->Row[{Style["{"],Style["X",Italic],", ",Style["Y",Italic],Style["}"]}],2->Row[{Style["{"],Style["x",Italic],", ",Style["y",Italic],Style["}"]}]}},ControlPlacement->Right,SaveDefinitions->True]

Suppose a graph of a two-place relation P is given, and a relation R is defined by

R(X,Y)⇔P(a(X-b),c(Y-d)).

Then point {X,Y) is on the graph of R, iff, the point {x,y}={a(X-b),c(Y-d)} is on the graph of P. Then {X,Y}={x/a+b,y/c+d}={x/a,y/c}+{b,d}.

So to get the graph of R, the graph of P is scaled by {1/a,1/c}, and translated for {b,d}.

Contributed by: Izidor Hafner