Expand or shrink irregular polygon

by THavamani 2013-03-18 11:56:13

coordinate points for a irregular polygon like (x1,y1) ...(x1,y1).
<br/>
Solution:
<br/>
Simply multiply each coordinate by a fixed value to scale around the origin.
<br/>
for each vertex i
result[i].x = input[i].x * scale
result[i].y = input[i].y * scale
<br/>
If you want to scale around a different point
<i>translate to origin (subtract the scaling center)
scale by the correct amount (multiply by a constant)
translate from origin (add the scaling center)</i>
909
like
0
dislike
0
mail
flag

You must LOGIN to add comments