Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts

    Getting angles to rotate plane to some normal

    I was wondering if anyone knows to calculate any set of angles to rotate a plane with a normal n to a specified normal n' (or -n'). It does not matter at what point on the plane it gets rotated about.
    Trinithis

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Trinithis View Post
    I was wondering if anyone knows to calculate any set of angles to rotate a plane with a normal n to a specified normal n' (or -n'). It does not matter at what point on the plane it gets rotated about.
    Code:
    cos a = <n, n'> / (| n | . | n' |)
    <a,b> - scalar product of a and b
    | v | - must be probably 1 since n and n' are normals of the plane

    best regards
    Last edited by oesxyl; 10-05-2009 at 11:53 PM.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts
    Doesn't that only work in 2D? For 3D I would need (xRot, yRot, zRot) for each of the axes.
    Trinithis

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Trinithis View Post
    Doesn't that only work in 2D? For 3D I would need (xRot, yRot, zRot) for each of the axes.
    work for any dimension of the space because scalar product and vector size is redefined.( that if the space is liniar)

    Code:
    <x1, ..., xn> , <y1, ..., yn> = x1*y1 + ... + xn * yn
    Code:
    | <x1, ..., xn> | = sqrt(x1^2 + ...+ xn^2)
    the angle is in the plane defined by vectors x and y.

    best regards


  •  

    Posting Permissions

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