I am working on a project using polygons—a pentagon, specifically—and I want all of the sides to be 2 in. The radius doesn't matter to me. I can't figure out if there is any way to do this. I am using CS5.
I think I would do it like this:
Draw a pentagon in approximately the right size.
Draw a rectangle with width 2".
Snap guides to the sides of the rectangle.
Snap a (bottom) corner of the pentagon to a guide.
With the Scale tool (S) click on the point where the guide intersects the upper side of the pentagon (centre of red ring).
Hold down Shift and drag on the opposite lower corner of the pentagon until it snaps to the (right hand) guide.
Clocking in, Steve.
clon, you may use a radius of 1.7013 to get a side length of 2. The ratio is √(2/(5-√5)) for a pentagon.
But drawing is more fun, and only limited by the accuracy of Illy herself.
There are at least two (rather silly) ways of actually drawing the pentagon starting with one side.
There is at least one (rather silly) way of actually drawing the pentagon starting with one side.
Yes Jacob, I thought of that one. Silly isn’t it?!
Good formula. Thought you might have one up your sleeve.
Makes an interesting graph that goes from 2 for a straight line, through 1 for six sides to 0 for an infinite number of sides.
Illie says she can’t draw a polygon with fewer than 3 sides but I reckon that a polygon with less than 3 sides must be a straight line.
But drawing is more fun....
Scripting it is more fun
if (app.documents.length>0) polygonBySide ();
else alert ("no document to draw the polygon");
function polygonBySide() {
var title = "Create Polygon by Side";
var sideLen = Number(prompt ("Enter Side Length in Points", 20, title));
var numberOfSides = Number(prompt ("Enter number of sides", 5, title));
//var s = 2*r*Math.sin(Math.PI/n); // side length = 2*radius*sin(180 deg/number of sides)
var radius = sideLen/(2*Math.sin(Math.PI/numberOfSides));
var idoc = app.activeDocument;
var ctr = idoc.activeView.centerPoint;
var ipoly = idoc.pathItems.polygon (ctr[0], ctr[1], radius, numberOfSides);
}
For any polygon with side of length n the interior angle between sides is (n-2) × 180°/ n.
For a pentagon n=5, so the interior angle is
(5-2) × 180°/5.
5-2=3, 180°/ 5 = 36°, 3 × 36° = 108°
Draw a line segment of two inches.
With the rotate tool OPT/ALT-click the left anchor point, enter 108 for the angle, click Copy. Repeat until all five sides are drawn. Join at overlapping anchor points.
See post #7 which I quoted in post #8.
Then at some point Jacob edited his to “at least two (rather silly) ways”.
I first imagined drawing one side of a given length, rotate-copying it by a given number of degrees, snapping and joining endpoints etc. etc.
Which would be a pretty daft way of doing things given that Illie has a (not-very-good) Polygon tool.
The method sends one back to Illie88 in the eighties before she had one at all.
Steve, Peter, the second silly way I thought of (which made me edit from one to two, sorry Steve, I was unable to go back because the edit and your reply crossed each other), was to rotate a copy round the centre by 72 degrees then repeat twice, then drag each by end points to snap, then join.
A third, just about as silly, way is with the Transform pallete/panel.
Edit: Hi Peter, hi Steve. I seem to be too slow today (too).
So I'm the silly one. I was thinking that the method would be dead accurate (avoiding √2, √5, trig functions, etc.) for all values of n, which it is for n=1…n=6, but missing the fact that n=7 yields an irrational number, therefore an approximation. Might as well snap to guides. Or go to bed.
I actually discovered that the best most accurate way of creating a perfect polygon with defined sides is to create it manually with the line tool. A pentagon has five sides, each rotated at 72 degrees, so I made 2 inch line segments, copied and rotated them, placed them so they snap at each point. Then I highlighted them all and used the Join command.