|Re: [eigen] Eigen appears to rock.|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen appears to rock.
- From: "Thomas Vaughan" <tevaughan@xxxxxxxxx>
- Date: Wed, 20 Aug 2008 22:22:03 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=zHV4Hq48iE6gpv3iH622bQO0dP/chcAJNij4AQ8NR5M=; b=ued81M1cRv0qwVblXULL0wToAq5Ij40n3UA9jyWTmQ2jBvKYMz2ZJ4WPs6br4AUJGg PB6QS3sGBUvbzckbY+vkHZdsvmi0npBsw7uTOhRGc1jxkyCsnpYFNG4S12/Y+9OIaFPM dmnDKdfqHJ+Qug3SJddYvFJRMfrFLom9QU3lU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=cbyNzIsqoXFH1i7nXQxikQh/AOAnhP754cQgl9TuV2D0Dn51NjV+uZa0ZYjehjxkEC M8pE3Nzh6srVrCderWzeJd2DDk3zYfvJZe2iYCyq2uPITTUj4uIjsiY0Xdc6BvPVPFNX DJtr08iNVWN+Y7PCgHn2jVQmETdvHetKNxtuY=
On Wed, Aug 20, 2008 at 9:31 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx>
> Thanks for the kind words!
> For example, Transform3f is actually a 4x4 matrix and can represent
> any affine transformation on 3-space. You can multiply a Transform3f
> with a Vector3f.
Hmm. This seems a bit unfortunate. In my naive imagination, although
each of a Vector and a Point should have three components internally,
- Applying a Transform to a Vector should give only a rotation, whereas
applying the same Transform to a Point should give both a rotation
and a translation,
- The binary subtraction operator between two Points should return the
displacement Vector from one point to the other.
- The binary addition operator between a Point and a Vector should
return the Point at the head of the Vector when its tail rests at the
- Most ordinary matrix stuff should work for a Vector, but only a few
things, like those above, and individual coordinate access, should
work for a Point.
I've noticed that some nasty bugs can happen in application code because
there is no proper distinction enforced between a Point and a Vector.
For example, I've made the mistake of accidentally transforming point
coordinates as though they were vector components. If a quantity were
declared as a Point, then it would be nice by C++ typing to have the
compiler warn the programmer that he is trying to treat something as
though it were a Vector when it is really a Point. Alternatively it
would be nice for the compiler just to do the appropriate thing
automatically in the case of a coordinate transformation.
Maybe, in the multiplication against the Transform, this would be as
- converting a Vector to a four-dimensional column whose w-component is
- converting a Point to a four-dimensional column whose w-component is
I notice that operator* for Transform takes either an N-dimensional
vector or an (N+1)-dimensional homogeneous vector. Does "homogeneous
vector" imply unit value in the (N+1)-component? What (N+1)-component is
supplied for the N-dimensional vector in this case?
Thomas E. Vaughan
There are only two kinds of people; those who accept dogma and know it,
and those who accept dogma and don't know it. - G.K. Chesterton