Results 1 to 6 of 6

Thread: co-ordinate transformation

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    4

    co-ordinate transformation

    does anybody have a link or can explain how to transform a point from one co ordinate system to another ...

    so say I know where the point is in the first co ordinate system, and i know where the 2nd coordinate system is relative to the first ...

    Thanks for your help

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: co-ordinate transformation

    Quote Originally Posted by Helloo
    does anybody have a link or can explain how to transform a point from one co ordinate system to another ...

    so say I know where the point is in the first co ordinate system, and i know where the 2nd coordinate system is relative to the first ...

    Thanks for your help
    How many dimensions, 2 (plane), 3 (space)...?
    Is the second system rotated with respect to the first?
    Are the axes forming a 90 deg. angle or not?
    Are there any axis-reflections involved?
    ...?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: co-ordinate transformation

    Think about it this way; suppose the two coordinate systems had their origins at the same place, and suppose they're both cartesian. Then if you know the rotation angles in the three planes (i.e. how to rotate x, y and z to map to the new system), then you can quite easily work out using cos and sin what the new set of coordinates are.

    Once you've done that, you can apply a linear offset in each of the three directions (by just adding or subtracting to each vector component) to move the origins relative to each other.

    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  4. #4
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: co-ordinate transformation

    I got the feeling from your post that you didn't want to rotate, only to change origins while the axes remain pointing in their usual directions.

    If so, just do this:
    Let (x, y) = point in the first coordinate system.
    Let (X, Y) = point in the second coordinate system.
    Let the distance you travel from the origin of the first coordinate system to the origin of the second coordinate system along the "x" axis be x0, and along the "y" axis be y0.

    Then (x, y) in the second coordinate system is (x+x0, y+y0) in the first coordinate system. Also, (x, y) in the first coordinate system is (x-x0, y-y0) in the second coordinate system.

    So (x+x0, y+y0) = (X, Y),
    (x, y) = (x-x0, y-y0).

    By the way, transformations along these lines are called "gallilean transformations". Similar (but more complicated) ones are used extensively in relativity.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    4

    Re: co-ordinate transformation

    thank you all for replying ...

    actually .. i need to both rotate and translate ... in 3-D

    so from my understanding i subtract the offset and work out the angles for each direction ... and then i use euler angles to transform points ?

    and if I do use euler angles, should the sequence i choose make a difference ?

  6. #6
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: co-ordinate transformation

    Quote Originally Posted by Helloo
    thank you all for replying ...

    actually .. i need to both rotate and translate ... in 3-D

    so from my understanding i subtract the offset and work out the angles for each direction ... and then i use euler angles to transform points ?

    and if I do use euler angles, should the sequence i choose make a difference ?
    Succesive rotations do not commute so the order is important.
    If you work the transformations using matrices it becomes all much tidier.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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