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.

I have a polygon on which I'm applying a GeometricTransform and I want to get the coordinates of the transformed polygon. Graphics[g] works and shows it nicely, but Normal@g doesn't seem to work. What am I doing wrong?

g = GeometricTransformation[
     Polygon[{
      {-0.36551249999999996`, -0.29021463333333336`}, 
      {-0.36509784999999995`, -0.2812481916666667`}, 
      {-0.3619309499999999`, -0.2645122083333334`}, 
      {-0.3592788999999999`, -0.25668636666666667`}, 
      {-0.3520880999999999`, -0.2419782333333334`}, 
      {-0.34271569999999996`, -0.22834049999999997`}, 
      {-0.3254433499999999`, -0.209398275`}, 
      {-0.3055169`, -0.19159769999999998`}, 
      {-0.26311249999999997`,-0.15638130000000006`}, 
      {-0.24333994999999997`, -0.13744537499999998`}, 
      {-0.22632409999999997`, -0.11661089999999996`}, 
      {-0.21717969999999998`, -0.10129116666666663`}, 
      {-0.21341764999999996`, -0.09311782500000006`}, 
      {-0.16110257499999997`, 0.0714712708333333`}, 
      {-0.1087875`, 0.23606036666666666`}, 
      {-0.3035939666666666`, -0.33778329166666676`}, 
      {-0.32013196666666666`, -0.3382103666666666`}, 
      {-0.33230609999999994`, -0.33689943333333333`}, 
      {-0.3425458333333333`, -0.3340813000000001`}, 
      {-0.3508735666666666`, -0.32955116666666673`}, 
      {-0.3558780916666666`, -0.3249068666666666`}, 
      {-0.36091372499999996`, -0.3168879333333333`}, 
      {-0.3634749`, -0.3093918333333333`}, 
      {-0.365004675`, -0.3005295333333334`}, 
      {-0.36551249999999996`, -0.29021463333333336`}}
     ], 
     {{-0.14929987960875826`, -1.065591641272026`}, 
      {1.0642599291951356`, -0.14911329363618442`}
     }
   ]
share|improve this question
    
I do not believe Normal will give you the coordinates, but Polygon[...][[1]] will. –  rcollyer Oct 2 '12 at 18:41
    
@rcollyer he means the transformed coordinates. "When possible, Normal will perform the transformations explicitly:" –  Mr.Wizard Oct 2 '12 at 18:44
    
@Mr.Wizard ah, I see it now. And, I see his problem, too. –  rcollyer Oct 2 '12 at 18:47
1  
@rcollyer Ohhh... you meant it looks bad in mma. Yes, that I agree with — I was bitching about it a lot in chat when I first got my laptop (which is the chat discussion I linked to). Hopefully v9 supports retina. But then, if you had it in mma, you would've seen that it had a second argument because the little red triangle didn't pop up :) –  rm -rf Oct 2 '12 at 19:42

1 Answer 1

I don't know why Normal does not work, but you can perform at least the transformation shown like this:

pts = {{-0.36551249999999996`, -0.29021463333333336`}, \
{-0.36509784999999995`, -0.2812481916666667`}, {-0.3619309499999999`, \
-0.2645122083333334`}, {-0.3592788999999999`, -0.25668636666666667`}, \
{-0.3520880999999999`, -0.2419782333333334`}, {-0.34271569999999996`, \
-0.22834049999999997`}, {-0.3254433499999999`, -0.209398275`}, \
{-0.3055169`, -0.19159769999999998`}, {-0.26311249999999997`, \
-0.15638130000000006`}, {-0.24333994999999997`, \
-0.13744537499999998`}, {-0.22632409999999997`, \
-0.11661089999999996`}, {-0.21717969999999998`, \
-0.10129116666666663`}, {-0.21341764999999996`, \
-0.09311782500000006`}, {-0.16110257499999997`, 
    0.0714712708333333`}, {-0.1087875`, 
    0.23606036666666666`}, {-0.3035939666666666`, \
-0.33778329166666676`}, {-0.32013196666666666`, \
-0.3382103666666666`}, {-0.33230609999999994`, \
-0.33689943333333333`}, {-0.3425458333333333`, -0.3340813000000001`}, \
{-0.3508735666666666`, -0.32955116666666673`}, {-0.3558780916666666`, \
-0.3249068666666666`}, {-0.36091372499999996`, -0.3168879333333333`}, \
{-0.3634749`, -0.3093918333333333`}, {-0.365004675`, \
-0.3005295333333334`}, {-0.36551249999999996`, -0.29021463333333336`}};

tf = AffineTransform[{{-0.14929987960875826`, -1.065591641272026`}, \
{1.0642599291951356`, -0.14911329363618442`}}];

Graphics@Polygon[tf /@ pts]

Mathematica 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.