Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Bug introduced in 8.0 or earlier and persisting through 10.2 or later


I have the following mapping on the complex plane: $$ z \mapsto \tau \mu z-1, $$ where $\mu$ is complex, $\tau$ is real number. I want to draw the image of left unit semidisk and play with $\tau$.

μ = 0.16255558520216132` + 0.1849493244071408` I;

pic[τ_] := Block[{d, ds},
   d = Disk[{0, 0}, 1, {π/2, 3 π/2}];
   ds =
    Fold[GeometricTransformation, d,
       {RotationTransform[Arg@#, {0, 0}],
        ScalingTransform[τ Abs@# {1, 1}],
        TranslationTransform[{-1, 0}]
        }] & @ μ;
   Graphics@{Gray, d, Red, Opacity[.5], ds}
   ];

Manipulate[
 Dynamic@Show[pic[τ], Frame -> True, Axes -> True, 
   AxesOrigin -> {0, 0}, PlotRange -> zz {{-100, 100}, {-100, 100}},
   ImageSize -> 400
   ],
 {τ, 0.01, 1000, 0.01},
 {zz, 0.01, 10, 0.01}
 ]

Here zz is introduced to control zooming. The problem is that I get different (wrong) images for different zooms. It is clearly seen for big $\tau$'s.

enter image description hereenter image description hereenter image description here

It looks very like a bug, but I can not rule out that I'm making some silly mistake (Mathematica 8.0.4). So, what is the problem here and what is the best way of doing the job (I have several mappings for different $\mu$ actually)?

share|improve this question
1  
I'd have implemented pic[] this way: pic[τ_] := Block[{d, ds}, d = Disk[{0, 0}, 1, {π/2, 3 π/2}]; ds = GeometricTransformation[d, Composition[TranslationTransform[{-1, 0}], ScalingTransform[τ Abs[μ] {1, 1}], RotationTransform[Arg[μ], {0, 0}]]]; Graphics @ {Gray, d, Red, Opacity[.5], ds}] –  Guess who it is. Aug 17 '12 at 17:24
3  
Here's another way to visualize your transformation of a disk: ParametricPlot[Through[{Re, Im}[τ μ r Exp[I θ] - 1]], {r, 0, 1}, {θ, π/2, 3 π/2}]] –  Guess who it is. Aug 17 '12 at 17:38
    
@J.M. thank you very much! Unfortunately Composition produces the same erroneous result. ParametricPlot is a viable alternative. Still the problem with composite GeometricTransformations remains. –  faleichik Aug 17 '12 at 20:18
2  
Minimal example of the problem: Evaluate Graphics@GeometricTransformation[Disk[],Composition[ScalingTransform[{800,800}]‌​,RotationTransform[0.1,{0,0}]]] and resize the graphic with the mouse. –  Simon Woods Aug 17 '12 at 21:41
1  
You can apply the transformations beforehand to the key-coordinates of the disk, which transforms Disk[{0, 0}, 1, {α, β}] to Disk[{-1, 0}, τ Abs[μ], {α, β} + Arg[μ]]. This explicit form will work fine with Graphics. –  Silvia Aug 18 '12 at 17:57

1 Answer 1

up vote 2 down vote accepted

This is surely a bug. The misbehavior certainly persists through V10.2. In fact, the two images below are of the same computation. The only difference is where they appear on the screen (as I scrolled the notebook, the transformed red disk jumped around).

μ = 0.16255558520216132` + 0.1849493244071408` I;

pic[τ_] := Block[{d, ds, arc},
   d = Disk[{0, 0}, 1, {π/2, 3 π/2}];
   ds = GeometricTransformation[d, 
       TranslationTransform[{-1, 0}] . 
        ScalingTransform[τ Abs@# {1, 1}] .
        RotationTransform[Arg@#, {0, 0}]] &@ μ;
   Graphics@ {Gray, d, Red, Opacity[.5], ds}];

Manipulate[
 Dynamic@Show[pic[τ], Frame -> True, Axes -> True, 
   AxesOrigin -> {0, 0}, PlotRange -> 100 zz , 
   ImageSize -> 222], {τ, 0.01, 1000, 0.01}, {zz, 0.01, 10, 
  0.01}]

As others have observed, PlotRange and ImageSize can affect what it displayed.

Note that the graphics are sent to the front end with the disk inside GeometricTransformationBox (one with my code, three nested ones with the OP's code). They appear to be correct, so the issue is with the front end (or possibly the GPU, I suppose). The workarounds by Silvia and Guess who it is avoid the use of GeometricTransformationBox. This sort of misbehavior has been noted since, e.g. Weird behaviour when using Scale, Rotate in Graphics.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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