Results 1 to 2 of 2

Thread: [RESOLVED] Easiest method to calculate coordinates of turned polygon

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Resolved [RESOLVED] Easiest method to calculate coordinates of turned polygon

    Hi, I have the coordinates of a polygon
    for example:
    P(0).X=0 P(0).Y=1
    P(1).X=1 P(1).Y=0
    P(2).X=1 P(2).Y=-1
    P(3).X=-1 P(3).Y=-1
    P(4).X=-1 P(4).Y=0

    I need to get the coordinates of the shape after a turn of x degrees around the point in 0, 0?
    Do I have to convert each point to a vector (like P(0) 0 degrees, 1 unit) and than add the the angle x, and after that calculate the coordinates from this vector?
    Isn't there an easier way?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Wink Re: Easiest method to calculate coordinates of turned polygon

    Found it myself!
    Make a "turning matrix" like
    cos(angle) -sin(angle)
    sin(angle) cos(angle)

    and multiply the points with this matrix, and I'm done!



    Hmmm, can I rate myself now??
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width