Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:32:32+00:00 2026-06-07T06:32:32+00:00

I have created a Hexagon with RaphelJS, but I could not find a nice,

  • 0

I have created a Hexagon with RaphelJS, but I could not find a nice, easy tutorial on how I can flip the Hexagon.

Here is the current hexagon creation 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 < 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");
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:32:34+00:00Added an answer on June 7, 2026 at 6:32 am

    How do you wish to flip the hexagon? If you only wish to flip horizontally or vertically, you can use the scale function. The documentation lists it like this:

    Element.scale(sx, sy, [cx], [cy])
    

    and you can insert a negative sx (flip horizontally) or sy (flip vertically). Since you want your hexagon to stay the same size, use the value -1 for either:

    hex1.scale(1,-1, 0, 0);
    

    Update: Apparently the scale function has been deprecated, so you should use the transform function instead, and remember to adjust for translation after the scale (or scale around the center of the hexagon). So the code would look like this (with a 500ms ease out effect) :

    hex1.animate({transform: "S-1,1"},500,'easeOut'); 
    

    Or

    hex1.transform("S-1,1")
    

    without the animation effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created form using ModelForm but its not saving data into database. views.py
Have created a UIButton programmatically, all works as expected but how can I use
I have created a Hexagon component that extends JPanel . It draws a hexagon
i have created one jsp file but it doesn't running in any way..!! it
I have created a custom JTree. That tree could be filtered to show only
I have created a triangle using canvas but i was wondering if there was
I have created a webservice that can upload files to my sharepoint site library.
I have created an ajax driven website which can load any page when given
I have created a QWidget with a bunch of QToolButtons in it and I
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.