2
$\begingroup$

I'm trying to do this. it doesn't have to be the same.

enter image description here

$\endgroup$
2
$\begingroup$

enter image description here

Use two functions of your choice:

f1[x_] := -x - Piecewise[{{2 Sin[x ], -2 Pi <= x <= 2 Pi}}]
f2[x_] := x + Piecewise[{{2 Sin[2 x], Abs[ x] <= 3 Pi/2}}]

options = {AspectRatio -> 1, 
   PlotRange -> {{-3 Pi, 3 Pi}, {-3 Pi, 3 Pi}}, Frame -> True, 
   Axes -> False, FrameTicks -> None, ImageSize -> 300};

Plot the functions f1 and f2 with the option Filling:

plota = Plot[{f1[x], f2[x]}, {x, -6 Pi, 6 Pi}, 
  Exclusions -> None, 
  PlotStyle -> ColorData[97]@1, 
  Filling -> {1 -> {2}}, 
  Evaluate @ options]

enter image description here

Use GeometricTransformation + RotationTransform to rotate plota primitives by desired angles and use the option PlotRange to crop resulting graphics:

Multicolumn[
 Table[Legended[
   Show[MapAt[GeometricTransformation[#, RotationTransform[a]] &, plota, {1}], 
     Evaluate @ options], 
   Placed[Style[a, 16], {.5, .9}]], {a, Subdivide[0, 2 Pi, 8]}], 
 3, Appearance -> "Horizontal", Spacings -> {0, 0}]

enter image description here

Animation above is produces using:

frames = Table[Show[MapAt[GeometricTransformation[#, RotationTransform[a]] &, 
     plota, {1}], ImageSize -> 500, Evaluate @ options], 
   {a, Subdivide[0, 2 Pi, 50]}];

Export["rotations.gif", frames, "AnimationRepetitions" -> Infinity]
$\endgroup$
1
$\begingroup$

(b) is problematic because it does not contain the same pixels as (a) and (b).

Look at the following:

ImageRotate[im, #] & /@ {0,-Pi/4,-Pi/2}

enter image description here

It looks like you rotated a larger picture and cut it to size.

$\endgroup$

Your Answer

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

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