Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

finding a point on a circle...

  • 26-03-2008 12:33am
    #1
    Closed Accounts Posts: 14


    Hi,

    Could someone help me calculate a specific point on a circle when already given:

    1) the radius of the circle
    2) a point on the circle
    3) and the angle of rotation away from that point.

    So say a point moved 45 degrees along the circumference how do you calculate the co-ordinates of the new point?

    Thanks,

    Colm


Comments

  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Ok, I haven't verified this yet, but I think it should work.

    In general, if you want to rotate a vector (x,y) around the origin by an angle A, you multiply it by the matrix

    | Cos A -Sin A|
    | Sin A Cos A |

    (with the matrix on the left)

    If (x,y) is a point on the circle, and the center of the circle was at 0,0, then this would give your answer. However, it doesn't work if the center of the circle isn't at 0,0. In that case, you need to translate your coordinates.

    If the center is at (J,K), and (X,Y) is your point on the circle, then do the matrix multiplication using (X - J, Y - K), and add (J,K) to your result.

    Like I said, I haven't tried it myself so I could be way off.


  • Registered Users, Registered Users 2 Posts: 1,595 ✭✭✭MathsManiac


    That sounds like a good plan to me!

    Also, if you really want to do it with matrix multiplication only, you can represent 2D points as 3D vectors (x,y,1) and then all affine transformations are implementable as matrix multiplication.

    See here:

    http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations

    M.


  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Hm, neat idea. I hadn't seen it before. (Or possibly wasn't paying attention when I did see it :D )


  • Registered Users, Registered Users 2 Posts: 1,501 ✭✭✭Delphi91


    Earls wrote: »
    Hi,

    Could someone help me calculate a specific point on a circle when already given:

    1) the radius of the circle
    2) a point on the circle
    3) and the angle of rotation away from that point.

    So say a point moved 45 degrees along the circumference how do you calculate the co-ordinates of the new point?

    Thanks,

    Colm

    The coordinates of the new point are (rsinA, rCosA) where A is the angle of rotation measured in an anticlockwise direction relative to a line from the centre to the point (r,0) and r is the length of the radius.

    The above assumes a circle centered on (0,0).


  • Registered Users, Registered Users 2 Posts: 2,481 ✭✭✭Fremen


    Delphi91 wrote: »
    The coordinates of the new point are (rsinA, rCosA) where A is the angle of rotation measured in an anticlockwise direction relative to a line from the centre to the point (r,0) and r is the length of the radius.

    The above assumes a circle centered on (0,0).


    I don't think that would work. Take A = 0, and it doesn't give you back what you put in.

    If you took the transform to be (rCos(A), rSin(A)) you would get a special case of what I wrote above.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,595 ✭✭✭MathsManiac


    Earls,

    In case you weren't following how to do what Fremen said at the start, here are the specifics of applying it to your case:

    Given a circle whose centre has co-ordinates (h,k),
    Then the image of the point (x,y) under an anticlockwise rotation of A degrees around the point (h,k) is the point (x',y'), where:
    x' = (x-h)cosA - (y-k)sinA + h
    y' = (x-h)sinA + (y-k)cosA + k

    Note, by the way, that it doesn't matter whether your point is on any predetermined circle. What's just described rotates any point (x,y) through an angle of A degrees around the point (h,k). Although, if you wish, you can think of the point starting to trace out a circle around the centre (h,k) as you rotate it.


  • Closed Accounts Posts: 14 Earls


    The matrix multiplication was exactly what I was looking for.
    Thank you all.


  • Registered Users, Registered Users 2 Posts: 1,501 ✭✭✭Delphi91


    Fremen wrote: »
    I don't think that would work. Take A = 0, and it doesn't give you back what you put in.

    If you took the transform to be (rCos(A), rSin(A)) you would get a special case of what I wrote above.

    Fair point. My brain has been a bit fried lately and I didn't bother to check that as I normally would! Mea culpa.


Advertisement