Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PumpkinPieman

Vertices of a Hexagon

This topic is 5224 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know where these vertices are in relation to the center point (assuming of course that all sides are equal and are of a value of 1)? I''m not too great at geometry, so I have no clue how to find these out. If you do find them out rational numbers would be most appreciated. Thanks.
Pumpkin Pieman - [Blogger]

Go to war again, blood is freedom''s stain, But don''t you pray for my soul anymore.

Share this post


Link to post
Share on other sites
Advertisement
That''s not a hexagon. A hexagon has six corners.

The generation is rather simple for any n-sided polygon if you want all sides the same length. Let be a := 2 * pi / n. Then the corners simply have the coordinates (cos(i * a), sin(i * a)), 0 <= i < n.

Share this post


Link to post
Share on other sites
Whoops, my mistake I guessed I was so focused on the music that I drew the diagram wrong. lol

[EDIT] There I fixed it, lol.

[edited by - PumpkinPieman on April 3, 2004 4:14:43 AM]

Share this post


Link to post
Share on other sites
Thanks that worked great! I got one last question: when I generated the numbers for the third number out of 6 sides, it came really close to zero (which it''s supposed to) but not 0. Should it do this? It came to (-1, 1.22461^-16) and it should be directly across from (1, 0).

Thanks

Share this post


Link to post
Share on other sites
That kind of imprecision is to be expected and about normal. A magnitude of about 1e-16 should, however, really evaluate as zero for any drawing routine.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!