Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #9054

Re: Rotating a point in 3D Sspace

From jt@toerring.de (Jens Thoms Toerring)
Newsgroups comp.lang.c++
Subject Re: Rotating a point in 3D Sspace
Date 2011-08-18 19:31 +0000
Organization Freie Universitaet Berlin
Message-ID <9b57jlFiglU1@mid.uni-berlin.de> (permalink)
References <4e4d3232$0$2772$703f8584@news.kpn.nl>

Show all headers | View raw


ldries46 <bertus.dries@planet.nl> wrote:
> Is there somewhere a standard routine for rotating a point in 3D stace in 
> the two directionsgiven the angles Theta and phi

There isn't, already since there is no "point in 3D space"
defined in the standard. You could be talking about three
floating point values representing the "point" (in cartesian
spherical, cylindrical or even some kind of elliptical coor-
dinates etc.) or you may have some class that represents a
"point" in whatever way you deem to suit for your problem
best etc.

And then it's not clear what you mean by "rotation in the di-
rections given the angles theta and phi". Theta and phi are
normally used as the names of the two angles describing (to-
gether with the radius) the position of a point in spherical
coordinates. If you want to rotate the point by an angle you
must also tell which axis the rotation is to be done around,
just having an angle won't do. Phi and theta don't define di-
rections by themselves. It might be possible that you mean
by "rotation in the direction given by phi" a rotation around
the z-axis by the angle phi, and for theta a rotation around
the direction perpendicular to the plane defined by the z-axis
and the vector from the origin to the point under consideration.
Or you might be talking about Euler angles. But this is just
pure speculation...

Rotations around two axes also require the sequence the rota-
tions are to be done in to be specified since rotations are
non-commutative (i.e. if you turn something e.g. around the
z-axis by 90 degrees first and then around the x- axis also
by 90 degress you will end up at a different position than
when you do the second rotation first and only then the se-
cond).
                            Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Rotating a point in 3D Sspace "ldries46" <bertus.dries@planet.nl> - 2011-08-18 17:41 +0200
  Re: Rotating a point in 3D Sspace Fred <fred.l.kleinschmidt@boeing.com> - 2011-08-18 09:07 -0700
  Re: Rotating a point in 3D Sspace jt@toerring.de (Jens Thoms Toerring) - 2011-08-18 19:31 +0000

csiph-web