
On Wed, Jun 14, 2006 at 07:58:28PM +0100, Andy Little wrote:
"Janek Kozicki" wrote
Geoffrey Irving said: (by the date of Tue, 13 Jun 2006 09:30:39 -0700)
I would suggest that instead of trying to make an extremely general vector class, it'd be better to make an extremely specific vector class, together with an extremely general way to other vector classes.
Specifically, you can make vector3 (or vector<3>, perhaps) a straightforward single unit Euclidean vector. It can have L2 norms and L^inf norms and cross products and all the operations that are undefined for vectors with components of different units. Then we could define a vector space variant of boost::operators to convert any tuple-like type into a vector space type.
PS: I like vector<3> , I think that Andy can't argue with this name :>
I like it. and I agree that it would be vector<3,T>. It conflicts with (later in the discussion) suggestions of tuple like behaviour though, however I like vector<3,T> primarily because mathematically challenged souls such as myself find it easier to understand. IMO Simplicity is an important and sometimes underrated design feature. The 3 there gives a good indication of what to expect. IOW the vector<3,T> is "a straightforward single unit Euclidean vector" as described by Geoffrey Irving.
And not quite off-topic: making that would have been rather nastier without being able to templatize over dimension. Debugging in 2d is a
I would suggest, not a vector3 or vector<3>, but to support math with 3D transformation matrices, which is 4x4 matrix, with a vector4 or vector<4>, if 3 space is the desired representation. When doing transformations to vectors, you must use 1 dimension high than the level you are working in. If done properly, quaterion support can also be obtained, which is another way to represent rotations of vectors. I believe we need these contruct to work together in a complete solution, not just a piece. Dave -----Original Message----- From: Janek Kozicki [mailto:janek_listy@wp.pl] Sent: Wednesday, June 14, 2006 2:46 PM To: boost@lists.boost.org Subject: Re: [boost] [pqs] Vector<3> Geoffrey Irving said: (by the date of Wed, 14 Jun 2006 12:49:56 -0700) lifesaver.
Anything that makes that easier is good (vector<3,T> vs. vector3<T>).
good point. -- Janek Kozicki | _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost