1
$\begingroup$
p = {1, 1}; q = {3, 2};
ray = Line[{p, q}];
t[v_, p_] := ReflectionTransform[v, p];
r[deg_, p_] := RotationTransform[deg, p];
s[x_] := TranslationTransform[x];

Table[Framed@
  Graphics[{ray, 
    f[ray], {PointSize[Medium], Point[p], Point[q], f[Point[p]], 
     f[Point[q]]},
    Text["P", Offset[{-5, 10}, p]],
    Text["Q", Offset[{0, 10}, q]] ,
    Text["P'", Offset[{-5, 10}, f[p]]],
    Text["Q'", Offset[{0, 10}, f[q]]]},
   Axes -> True, AxesOrigin -> {0, 0}, ImageSize -> {200, 200}],
 {f, {t[{0, 1}, {0, 0}], r[90 °, {0, 0}], s[{1, 2}]}}]

output

I got this output. I'm only missing the PlotLabels, how do I add them for each plot inside Table? I tried adding a second iterator list after f but then I get 9 plots instead of 3 as output.

p = {1, 1}; q = {3, 2};
ray = Line[{p, q}];
t[v_, p_] := ReflectionTransform[v, p];
r[deg_, p_] := RotationTransform[deg, p];
s[x_] := TranslationTransform[x];

Table[Framed@
  Graphics[{ray, 
    f[ray], {PointSize[Medium], Point[p], Point[q], f[Point[p]], 
     f[Point[q]]},
    Text["P", Offset[{-5, 10}, p]],
    Text["Q", Offset[{0, 10}, q]] ,
    Text["P'", Offset[{-5, 10}, f[p]]],
    Text["Q'", Offset[{0, 10}, f[q]]]},
   Axes -> True, AxesOrigin -> {0, 0}, PlotLabel -> label, 
   ImageSize -> {200, 200}],
 {f, {t[{0, 1}, {0, 0}], r[90 °, {0, 0}], s[{1, 2}]}},
 {label, {"Reflection", "Rotation", "Translation"}}]
$\endgroup$

1 Answer 1

2
$\begingroup$
$Version

"13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)"

ClearAll["Global`*"]

p = {1, 1}; q = {3, 2};
ray = Line[{p, q}];
t[v_, p_] := ReflectionTransform[v, p];
r[deg_, p_] := RotationTransform[deg, p];
s[x_] := TranslationTransform[x];

Framed@Graphics[{ray, #[[1]][ray],
      {PointSize[Medium],
       Point[p], Point[q], #[[1]][Point[p]], #[[1]][Point[q]]},
      Text["P", Offset[{-5, 10}, p]],
      Text["Q", Offset[{0, 10}, q]],
      Text["P'", Offset[{-5, 10}, #[[1]][p]]],
      Text["Q'", Offset[{0, 10}, #[[1]][q]]]},
     Axes -> True,
     AxesOrigin -> {0, 0},
     ImageSize -> {200, 200},
     PlotLabel -> #[[2]]] & /@
  Transpose[{{t[{0, 1}, {0, 0}], r[90 °, {0, 0}], 
     s[{1, 2}]}, {"Reflection", "Rotation", "Translation"}}] //
 Row[#, Spacer[5]] &

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.