0 Members and 1 Guest are viewing this topic.

What about equilateral triangles / pentagons / heptagons / nonagons ...

Alternative method (the most accurate)

Nice Evgeniy To offer an alternative...

Quote from: Lee Mac on January 14, 2013, 07:52:03 AMNice Evgeniy To offer an alternative...I was thinking of something similar. Your routine works for any regular polygon, including star shape, but fails for rectangles and for any shape containing exclusively right angles, because dot_product is 0.0 for perpendicular vectors.

I was thinking of something similar. Your routine works for any regular polygon, including star shape, but fails for rectangles and for any shape containing exclusively right angles, because dot_product is 0.0 for perpendicular vectors.

Quote from: Stefan on January 14, 2013, 11:05:01 AMI was thinking of something similar. Your routine works for any regular polygon, including star shape, but fails for rectangles and for any shape containing exclusively right angles, because dot_product is 0.0 for perpendicular vectors. square of is a regular polyhedronrectangle, this is the wrong polyhedron

Now: I'm unsure what to do since the function name clearly states it should be regular polygons, but a rectangle is strictly speaking not "regular". So should consecutive vectors' lengths also be checked? That's not actually what the OP asked for is it?