Results 1 to 2 of 2

Math Help - Using sin and cos to rotate a point

  1. #1
    Newbie
    Joined
    May 2007
    Posts
    4

    Using sin and cos to rotate a point

    Hello. Im trying to move a point in 2D space. If i apply a rotation to the point, and then try to move it again, i want it to move along the axis defined in its local space insted of the 'world' space.

    Ive been told i can do this by using the angle im rotating the point by like so :-
    pos.X += Cos(rotate)
    pos.Y += Sin(rotate)

    this will make any movements along the x axis correct. Its similar for Y, i just have to swap the Cos and Sin around. The only probly is, im not sure why this works. Anyone know why? I hope i managed to explain it clearly enough!

    Thanks for your help!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,842
    Thanks
    320
    Awards
    1
    Quote Originally Posted by Cubed2D View Post
    Hello. Im trying to move a point in 2D space. If i apply a rotation to the point, and then try to move it again, i want it to move along the axis defined in its local space insted of the 'world' space.

    Ive been told i can do this by using the angle im rotating the point by like so :-
    pos.X += Cos(rotate)
    pos.Y += Sin(rotate)

    this will make any movements along the x axis correct. Its similar for Y, i just have to swap the Cos and Sin around. The only probly is, im not sure why this works. Anyone know why? I hope i managed to explain it clearly enough!

    Thanks for your help!
    Not quite following what you are saying.

    Are you saying you want a way to rotate, say (1, 0) about a point, say the origin (0, 0)? Or are you asking about something else?

    -Dan
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Move and Rotate a point around a new origin
    Posted in the Advanced Applied Math Forum
    Replies: 24
    Last Post: February 25th 2011, 02:33 AM
  2. Rotate Vector
    Posted in the Trigonometry Forum
    Replies: 6
    Last Post: February 2nd 2011, 11:11 PM
  3. Rotate a rectangle with respect to a point
    Posted in the Trigonometry Forum
    Replies: 2
    Last Post: August 20th 2009, 02:13 AM
  4. Rotate a line about a point
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: August 18th 2009, 10:24 AM
  5. [SOLVED] Rotate about a pivot point
    Posted in the Trigonometry Forum
    Replies: 1
    Last Post: August 4th 2009, 06:48 AM

Search Tags


/mathhelpforum @mathhelpforum