Skip to main content
formatting, punctuation, typo
Source Link
Brett Champion
  • 20.9k
  • 2
  • 65
  • 122

Background: I have a geometric transformation composed of a RotationTransformRotationTransform, ScalingTransformScalingTransform and ShearingTransformShearingTransform, I can use dynamic constructs with rotations and scalings but this does not ( seemseem to  ) work with the ShearingTransformShearingTransform.

Consider the following snippet:

  DynamicModule[{shr, deg = 30},
   shr0 = ShearingTransform[deg Degree, {1, 0}, {0, 1}];
   shr1 = Dynamic[ShearingTransform[deg Degree, {1, 0}, {0, 1}]];
   shr2 = ShearingTransform[Dynamic[deg Degree], {1, 0}, {0, 1}];
  Column[{
     Slider[Dynamic[deg], {0, 90, 1}],
     GeometricTransformation[{Blue,
       Rectangle[{0, 0}, {3, 1}]},
      shr0] // Graphics}
   ]]

Note that the snippet does not work ( asas expected  ) : moving the slider does not change the angle of the shear. See shr1shr1 and shr2shr2 for alternatives I have already tried.

Question: How can I make the angle in a ShearingTransformShearingTransform dynamic?, sucnsuch that it works in the context of the snippet above.?

Background: I have a geometric transformation composed of a RotationTransform, ScalingTransform and ShearingTransform, I can use dynamic constructs with rotations and scalings but this does not ( seem to  ) work with the ShearingTransform.

Consider the following snippet:

  DynamicModule[{shr, deg = 30},
   shr0 = ShearingTransform[deg Degree, {1, 0}, {0, 1}];
   shr1 = Dynamic[ShearingTransform[deg Degree, {1, 0}, {0, 1}]];
   shr2 = ShearingTransform[Dynamic[deg Degree], {1, 0}, {0, 1}];
  Column[{
     Slider[Dynamic[deg], {0, 90, 1}],
     GeometricTransformation[{Blue,
       Rectangle[{0, 0}, {3, 1}]},
      shr0] // Graphics}
   ]]

Note that the snippet does not work ( as expected  ) : moving the slider does not change the angle of the shear. See shr1 and shr2 for alternatives I have already tried.

Question: How can I make the angle in a ShearingTransform dynamic?, sucn that it works in the context of the snippet above.

Background: I have a geometric transformation composed of a RotationTransform, ScalingTransform and ShearingTransform, I can use dynamic constructs with rotations and scalings but this does not (seem to) work with the ShearingTransform.

Consider the following snippet:

  DynamicModule[{shr, deg = 30},
   shr0 = ShearingTransform[deg Degree, {1, 0}, {0, 1}];
   shr1 = Dynamic[ShearingTransform[deg Degree, {1, 0}, {0, 1}]];
   shr2 = ShearingTransform[Dynamic[deg Degree], {1, 0}, {0, 1}];
  Column[{
     Slider[Dynamic[deg], {0, 90, 1}],
     GeometricTransformation[{Blue,
       Rectangle[{0, 0}, {3, 1}]},
      shr0] // Graphics}
   ]]

Note that the snippet does not work (as expected) : moving the slider does not change the angle of the shear. See shr1 and shr2 for alternatives I have already tried.

Question: How can I make the angle in a ShearingTransform dynamic, such that it works in the context of the snippet above?

Tweeted twitter.com/#!/StackMma/status/209106159188180993
Source Link
nilo de roock
  • 9.7k
  • 3
  • 35
  • 79

ShearingTransform and Dynamic

Background: I have a geometric transformation composed of a RotationTransform, ScalingTransform and ShearingTransform, I can use dynamic constructs with rotations and scalings but this does not ( seem to ) work with the ShearingTransform.

Consider the following snippet:

  DynamicModule[{shr, deg = 30},
   shr0 = ShearingTransform[deg Degree, {1, 0}, {0, 1}];
   shr1 = Dynamic[ShearingTransform[deg Degree, {1, 0}, {0, 1}]];
   shr2 = ShearingTransform[Dynamic[deg Degree], {1, 0}, {0, 1}];
  Column[{
     Slider[Dynamic[deg], {0, 90, 1}],
     GeometricTransformation[{Blue,
       Rectangle[{0, 0}, {3, 1}]},
      shr0] // Graphics}
   ]]

Note that the snippet does not work ( as expected ) : moving the slider does not change the angle of the shear. See shr1 and shr2 for alternatives I have already tried.

Question: How can I make the angle in a ShearingTransform dynamic?, sucn that it works in the context of the snippet above.