Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rotating Shapes (2D C++)

  1. Apr 9, 2009 #1
    I'm creating a C++ 2D program to practice my 2D skills. I'm almost done with everything but I'm stuck on this crap. Is there any formula on how to rotate a shape?

    Example:

    I have a line P1(-1,-1) P2(1,1)

    If I rotate it by 45 degrees, I'll get a P1(1,-1) P2(-1,1). By the way, it should not leave its center which is C(0,0).
     
  2. jcsd
  3. Apr 9, 2009 #2
  4. Apr 10, 2009 #3
    Ok thanks I got it.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?