|
Boost : |
From: Olivier Grant (olivier.grant_at_[hidden])
Date: 2006-09-20 18:38:54
On 9/20/06, james.jones_at_[hidden] <james.jones_at_[hidden]>
wrote:
>
> From: "Olivier Grant" <olivier.grant_at_[hidden]>
> On 9/20/06, Walter Landry <wlandry_at_[hidden]> wrote:
> > > This seems wrong. If I want to add a vector2d to a vector3d, then I
> > > should have to do it manually. Otherwise, it should be a type error.
> >
> > it depends how you see the problem I suppose. A 2D vector is just a 3D
> > vector with z == 0. A 3D vector is a 4D vector with w == 1. And so on by
> > extension. Since these vector classes are not supposed to be used in a
> > polymorphic way, each argument of a function call is well-known by the
> user
> > - or at least should be :) - so I would not raise an exception in the
> case
> > of the use of two vectors with different dimensions.
>
> But a 2D vector is NOT just a 3D vector with z = 0!! It might sit in a
> subspace of a 3D vector space, but not necessarily in the z=0 plane. It
> could just as easily be a 2D vector in the x - 2y + 3z = 0 plane.
I completly agree. I was implying that they both use the same global
coordinate system. To me, what you are saying in your example - with the 2D
vector plane being x - 2y + 3z - means that they don't use the same
coordinate system. The work could be extended so vectors can be converted
from one subspace to another. Adding a 2D vector and a 3D vector would
convert the 2D vector to the corresponding 3D vector based on the plane in
the 3D space it resides in - not sure that was clear but I'm sure you get
the point :).
Certainly do it this way if you want to - maybe it makes perfect sense for
> your particular application. But I'd never want to see something like this
> standardized in BOOST. It just ain't right. :)
I wasn't even proposing this as a BOOST lib, even though I would be
interested in taking part in the development of one. Is there any work being
done on this or is there already a library considered to implement all
geometrical vector algebra that meets BOOST standards ?
Also, if a 2D vector is a 3D vector with z=0, and a 3D vector is a 4D vector
> with w=1, "and so on by extension", then how would a 4D vector compare with
> a 5D vector? I don't get the extension. When you first posted your example,
> I assumed you'd made a typo when you set w=1, but now I think you did that
> on purpose. Why wouldn't w=0?
I was thinking of 3D control points, but that was a bad example. I just
wanted to point out that the implementation allowed users to define specific
default values for each coordinate.
-
> James Jones Administrative Data Mgmt.
> Webmaster 375 Raritan Center Pkwy, Suite A
> Data Architect Edison, NJ 08837
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Thanks for your comments and questions,
Olivier.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk