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

Discussion in 'C Programming' started by Shamli, Oct 10, 2003.

  1. Shamli

    Shamli Guest

    I am looking for an algorithm that enlarge a 2D polygon.
    cheers,
     
    Shamli, Oct 10, 2003
    #1
    1. Advertising

  2. news:

    > 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 *= zoom;
    y *= zoom;


    --
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
    GG-1175498 ____| ]____,
    Rafal 'Raf256' Maj X-( * )
    Rafal(at)Raf256(dot)com ,"----------"
     
    Rafal 'Raf256' Maj, Oct 10, 2003
    #2
    1. Advertising

  3. Shamli

    Shamli Guest

    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" <> wrote in message news:<Xns941195E9139Eraf256com@213.180.128.20>...
    > news:
    >
    > > 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 *= zoom;
    > y *= zoom;
     
    Shamli, Oct 11, 2003
    #3
  4. On Sat, 11 Oct 2003, Shamli wrote:
    >


    [re-arranged for clarity]
    Please, please, please don't top-post!

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

    > "Rafal 'Raf256' Maj" <> wrote in message news:<Xns941195E9139Eraf256com@213.180.128.20>...
    > > news:
    > >
    > > > 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 *= zoom;
    > > y *= 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
     
    Arthur J. O'Dwyer, Oct 11, 2003
    #4
  5. news:

    > 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
    to my whitelist)


    --
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
    GG-1175498 ____| ]____,
    Rafal 'Raf256' Maj X-( * )
    Rafal(at)Raf256(dot)com ,"----------"
     
    Rafal 'Raf256' Maj, Oct 11, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Qoo

    Enlarge the stack size in gcc ?

    Qoo, Jun 21, 2005, in forum: C Programming
    Replies:
    3
    Views:
    728
    Anonymous 7843
    Jun 21, 2005
  2. K.

    a href area to enlarge

    K., Jun 22, 2007, in forum: HTML
    Replies:
    11
    Views:
    1,275
    dorayme
    Jun 24, 2007
  3. robos85

    PIL how to enlarge image

    robos85, Dec 4, 2010, in forum: Python
    Replies:
    1
    Views:
    398
    Alain Ketterlin
    Dec 4, 2010
  4. Stefan Salewski
    Replies:
    2
    Views:
    142
    Stefan Salewski
    Apr 12, 2011
  5. Eraserhead

    Click to enlarge issues

    Eraserhead, Jul 23, 2003, in forum: Javascript
    Replies:
    2
    Views:
    125
    Hywel Jenkins
    Jul 24, 2003
Loading...

Share This Page