Abril 1997 Hello all, I have a question about a point rotating around an axis in 3D space, Given: -- Two points: (Ax, Ay, Az) and (Bx, By, Bz) that define a line (or an "axis"). -- Another point: (Px, Py, Pz), and -- An angle: "a". Which is the position P' of the point P, after rotating it "a" radians around the axis AB? What I would like to know is P'x, P'y and P'z as a function of A, B, P and "a". Being this function as simple as posible. Please write your answer to my e-mail too, because I'm not always looking at sci.math. Sincerely, @-->----- Josechu (Jose Gonzalez) josechu@redestb.es http://www.geocities.com/CapeCanaveral/3325 From: "John L. Richardson" Organization: Silicon Graphics, Inc. X-Mailer: Mozilla 3.01SC-SGI (X11; I; IRIX 6.2-ALPHA-1232729832 IP22) MIME-Version: 1.0 Newsgroups: sci.math To: josechu Subject: Re: A point rotating around an axis References: <3364b1b9.8102321@news.dma.be> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit josechu wrote: >... >... Jose, Let n be the unit vector pointing from A to B (nx,ny,nz) = (Bx-Ax,By-Ay,Bz-Az)/Sqrt[(Bx-Ax)^2+(By-Ay)^2+(Bz-Az)^2] Then (using 3D vectors): P' = n(n.P) + cos(a)[P - n(n.P)] + sin(a) n cross P I hope this helps! Cheers, John -- John L. Richardson Silicon Graphics, Inc. E-Mail: jlr@sgi.com http://reality.sgi.com/jlr  ¼ HJ 5J â Return-Path: Received: from server2.redestb.es ([194.179.106.8]) by mx0.redestb.es (post.office MTA v2.0 0813 ID# 0-12342) with ESMTP id AAA136 for ; Tue, 29 Apr 1997 09:13:18 +0200 Received: from mail1y-int.prodigy.net ([198.83.19.113]) by server2.redestb.es (post.office MTA v2.0 0813 ID# 0-12342) with ESMTP id AAA178 for ; Tue, 29 Apr 1997 09:12:07 +0200 Received: from port22.lvga.prodigy.net (port22.lvga.prodigy.net [204.237.175.22]) by mail1y-int.prodigy.net (8.7.5/8.7.3) with SMTP id DAA07734 for ; Tue, 29 Apr 1997 03:06:44 -0400 Message-ID: <33659DDD.5E05@prodigy.net> Date: Tue, 29 Apr 1997 00:06:05 -0700 From: Greg Barone Organization: Prodigy Internet X-Mailer: Mozilla 2.02 (Win16; I) MIME-Version: 1.0 To: josechu Subject: Re: A point rotating around an axis References: <3364b1b9.8102321@news.dma.be> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Compute the point on the axis that would be the center of the circle traced by the moving point. The point must be some point on line AB: P0 = (Axt+Bx(1-t), Ayt+By(1-t), Azt+Bz(1-t)) such that the vector P-P0 would have a zero dot product with vector A-B. To rotate the point to a P' position, solve for the coordinates of P' such that [(P'-P0) dot (P-P0)]/(the square of the norm of P-P0) = cos(a). Play around with the algebra, and it might get simpler. There might already be a formula for P0 in a linear algebra text. You'll have to stipulate which direction you're rotating. Cosine doesn't know the difference. I hope that helps.  ¾ ü é Return-Path: ------ From lounesto@dopey.hut.fi Tue Apr 29 18:20:22 1997 Newsgroups: sci.math Subject: Re: A point rotating around an axis From: Pertti Lounesto Date: 29 Apr 1997 19:20:22 +0300 josechu wrote: : I have a question about a point rotating around an axis in 3D space, : Given: : -- Two points: (Ax, Ay, Az) and (Bx, By, Bz) that define a : line (or an "axis"). : -- Another point: (Px, Py, Pz), and : -- An angle: "a". : Which is the position P' of the point P, after rotating it "a" : radians around the axis AB? : What I would like to know is P'x, P'y and P'z as a function of A, B, P : and "a". Being this function as simple as posible. John L. Richardson writes: > Let n be the unit vector pointing from A to B > (nx,ny,nz) = (Bx-Ax,By-Ay,Bz-Az)/Sqrt[(Bx-Ax)^2+(By-Ay)^2+(Bz-Az)^2] > Then (using 3D vectors): > P' = n(n.P) + cos(a)[P - n(n.P)] + sin(a) n cross P The above only gives P rotated around an axis parellel to AB through the origin 0. The original question has an answer P'=A+f(P-A) where f(P) = n(n.P) + cos(a)[P - n(n.P)] +- sin(a) n cross P.