title: Flipping a shape with RaphaelJS
body: <p>I have created a Hexagon with RaphelJS, but I could not find a nice, easy tutorial on how I can flip the Hexagon.</p>
  
  <p>Here is the current hexagon creation code:</p>
  
  <pre><code>function polygon(x, y, size, sides, rotate) {
  var self = this;
  
  self.centrePoint = [x,y];
  self.size = size;
  self.sides = sides;
  self.rotated = rotate;
  self.sizeMultiplier = 50;
  
  self.points = [];
  
  for (i = 0; i &lt; sides; i++) {
      self.points.push([(x + (self.size * self.sizeMultiplier) * (rotate ? Math.sin(2 * 3.14159265 * i / sides) : Math.cos(2 * 3.14159265 * i / sides))), (y + (self.size * self.sizeMultiplier) * (rotate ? Math.cos(2 * 3.14159265 * i / sides) : Math.sin(2 * 3.14159265 * i / sides)))]);
  }
  
  self.svgString = 'M' + self.points.join(' ') + ' L Z';
  }
  
  $(document).ready(function() {
  var paper = Raphael(0, 0, 450, 450);
  
  var path1 = new polygon(100, 100, 2, 6, false);
  var path2 = new polygon(205, 187, 1, 6, false);
  var path3 = new polygon(100, 277, 2, 6, false);
  
  var hex1 = paper.path(path1.svgString);
  var hex2 = paper.path(path2.svgString);
  var hex3 = paper.path(path3.svgString);
  
  hex1.node.id = "hex1";
  hex1.attr("fill", "#ccc");
  hex1.attr("stroke", "#aceace");
  });
  </code></pre>