Velocity Reviews > How to enlarge a 2D polygon (conex, nonconvex)

# How to enlarge a 2D polygon (conex, nonconvex)

Shamli
Guest
Posts: n/a

 10-10-2003
I am looking for an algorithm that enlarge a 2D polygon.
cheers,

Rafal 'Raf256' Maj
Guest
Posts: n/a

 10-10-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) news:(E-Mail Removed) m

> I am looking for an algorithm that enlarge a 2D polygon.
> cheers,

Is polygon is a set of 2D points, how about multiplying all of them by some
value ?

x[i] *= zoom;
y[i] *= zoom;

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
GG-1175498 ____| ]____,
Rafal 'Raf256' Maj X-( * )
Rafal(at)Raf256(dot)com ,"----------"

Shamli
Guest
Posts: n/a

 10-11-2003
yes the polygon is a set of 2D points;
No this will not work. by multiplying we are just moving the polygon.

"Rafal 'Raf256' Maj" <(E-Mail Removed)> wrote in message news:<Xns941195E9139Eraf256com@213.180.128.20>...
> (E-Mail Removed) news:(E-Mail Removed) m
>
> > I am looking for an algorithm that enlarge a 2D polygon.
> > cheers,

>
> Is polygon is a set of 2D points, how about multiplying all of them by some
> value ?
>
> x[i] *= zoom;
> y[i] *= zoom;

Arthur J. O'Dwyer
Guest
Posts: n/a

 10-11-2003

On Sat, 11 Oct 2003, Shamli wrote:
>

[re-arranged for clarity]

A: Because it's annoying as hell.
Q: Why shouldn't I top-post?

> "Rafal 'Raf256' Maj" <(E-Mail Removed)> wrote in message news:<Xns941195E9139Eraf256com@213.180.128.20>...
> > (E-Mail Removed) news:(E-Mail Removed) m
> >
> > > I am looking for an algorithm that enlarge a 2D polygon.
> > > cheers,

> >
> > Is polygon is a set of 2D points, how about multiplying all of them by some
> > value ?
> >
> > x[i] *= zoom;
> > y[i] *= zoom;

>
> yes the polygon is a set of 2D points;
> No this will not work. by multiplying we are just moving the polygon.

No, you're not. You're scaling it by the constant 'zoom'.
Try it and see. Alternately, you can keep the centroid of
the polygon in the same place by first scaling it, and *then*
translating ("moving") it back to the "right" place by adding
a second constant.

Take this to comp.programming (followups set).

-Arthur

Rafal 'Raf256' Maj
Guest
Posts: n/a

 10-11-2003
(E-Mail Removed) news:(E-Mail Removed) om

> yes the polygon is a set of 2D points;
> No this will not work. by multiplying we are just moving the polygon.

Wrong,
by multiplaying You *are* zooming (and maybe also moving - is object is not
centered before).

To just move we must add x+= y+=

Hm maybe I can write smale example for You, contact mu on priv (I'm adding
(E-Mail Removed) to my whitelist)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
GG-1175498 ____| ]____,
Rafal 'Raf256' Maj X-( * )
Rafal(at)Raf256(dot)com ,"----------"