Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

If I want to expand or reduce a shape what mathematical methods are there to do this.

I'd like to understand scaling which seems simple enough. Using my limited knowledge I would do this by measuring the angle and distance of each point from a given anchor point, and then re-plot them by multiplying the distance against a scaling factor.

scale shape

I have no idea how optimal this method is, or how to express it using mathematical notation, so I'd like to know.

I'd also very much like to understand how to make a shape expand or reduce around it's interior. For example, I thought it would be something like this...

enter image description here

I use a circle of a given radius on each point, and at each point create a bisecting line, then construct the larger or smaller shape using the intersecting points of the circles. However, as you can see this method has numerous errors, shape B obviously has angles that differ from shape A, what's the correct way to expand / shrink a shape in this manner?

Plain english and mathematical notation answers are gratefully requested, I'm still learning a lot of notation.

Update

I'm not sure that the second example is clear enough, so I've made this image to describe what I'm looking for.

enter image description here

Using this example, it's clear that projection scaling isn't going to produce the shape required. what is this sizing method called, and how is it done mathematically?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You can follow your anchor point (projection) approach using a point in the interior. That will preserve angles. It is not clear how you got from A to B in the second drawing. The lines between corresponding vertices do not meet in a point, which is why the angles change.

share|improve this answer
    
I've updated the text of my question to provide some clarity for the second part. I'll construct a shape that doesn't scale the way I want using projection if my example isn't one of these. –  Slomojo Jun 28 '11 at 0:12
1  
You can preserve angles, but not side ratios, by drawing a parallel to each side offset into the interior by a desired amount, then taking the intersections of the parallels. But if you want similarity (preserve angles and side ratios) your initial approach is the way to go. –  Ross Millikan Jun 28 '11 at 0:17
    
Please see my updated example. –  Slomojo Jun 28 '11 at 0:22
    
@slomojo Your updated example does exactly what Ross described. (Drawing parallel lines) –  trutheality Jun 28 '11 at 1:31
2  
According to Joeseph O'Rourke's answer, it is the offset curve, related to the Minkowski sum. One formulation is at cagd.cs.byu.edu/~557/text/ch8.pdf. For polygons, you can just find the slope-intercept equation for each side, add or subtract the correct constant from the intercept, then find the intersections to get the new corners. –  Ross Millikan Jun 28 '11 at 12:57
show 5 more comments

I understand that this is an old question and already has an accepted answer, but for anyone else landing here there is now a great open source library (free for commercial use) that will do polygon offsetting (amongst other things) called Clipper: http://www.angusj.com/delphi/clipper.php

share|improve this answer
    
An excellent resource, thank you. –  Slomojo Nov 5 '13 at 10:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.