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 4087818
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:54:11+00:00 2026-05-20T18:54:11+00:00

I have an array of position vertices that make up a 2D polygon. Vector2[]

  • 0

I have an array of position vertices that make up a 2D polygon.

        Vector2[] _chassisConcaveVertices =
        {
            new Vector2(5.122f, 0.572f),
            new Vector2(3.518f, 0.572f),
            new Vector2(3.458f, 0.169f),
            new Vector2(2.553f, 0.169f),
            new Vector2(2.013f, 0.414f),
            new Vector2(0.992f, 0.769f),
            new Vector2(0.992f, 1.363f),
            new Vector2(5.122f, 1.363f),
        };

What algorithm can I use to modify the positions so the resultant polygon is flipped? I need to flip the polygon both horizontally and vertically.

  • 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-05-20T18:54:12+00:00Added an answer on May 20, 2026 at 6:54 pm

    If you’re flipping around the point (0.0f,0.0f) you simply need to negate the values. So your shape would be:

        Vector2[] _chassisConcaveVertices =
        {
            new Vector2(-5.122f, -0.572f),
            new Vector2(-3.518f, -0.572f),
            new Vector2(-3.458f, -0.169f),
            new Vector2(-2.553f, -0.169f),
            new Vector2(-2.013f, -0.414f),
            new Vector2(-0.992f, -0.769f),
            new Vector2(-0.992f, -1.363f),
            new Vector2(-5.122f, -1.363f),
        };
    

    If you are flipping around a point (x,y) then each point will be (x – (p.x – x)) or (2*x-p.x) for the x value and (y – (p.y – y)) or (2*y-p.y) for the y value.

    This explains:
    . is the point you want to flip
    * is the point you want to flip around
    O is the point you want to end up with

      x axis
        ^
        |
        . -
        | | <-
        | | <- Let this be distance a
        * -
        | | <-
        | | <- This should be equal to a
        O -
        |
        |
        -------> y axis
    

    Let’s say the x values of . * and O are t, m and b respectively (top, middle and bottom). As you can see, the distance a = t-m and the b = m-a. Therefore b = m-(t-m) = m-t+m = m*2-t

    You can then use this principle to write an algorithm to flip all the points around a different point and this will give you your flipped polygon!

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

Sidebar

Related Questions

I have a Block class that basically contains an array of 36 vertices, a
I have a large array called data. At the 10th array position i have
I would like to have an array (or a vector) and at each position
Say we have array of arrays: tree_limbs = Array.new tree_limbs << %w(1 2 3
How can I retrieve the current position of the vertices after they have been
This should be so much simpler! I have an array of JSON objects that
I am trying to create a pacman-like game. I have an array that looks
I have an array that could contain zero values. $array = array(3=> 1000, 5=>
I have an array, that represents an inventory, with nearly 50 elements (items: some
I have an array which contains following values: str[0]= MeterNr 29202 str[1]=- 20111101: position

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.