I recommend taking a look at how eigen does things for ideas before any major design decisions, and consider the possibility of directly integrating with ublas as well once you start getting into real matrix operations.
Hi,/.../
Adam Wulkiewicz wrote:
Hi,
I've been thinking about additional concepts like vector, matrix, etc.
and how they could be used in Boost.Geometry. In our context they
probably should be seen only as translation and rotation representations.
So I think about following use cases:
In the free time you may check extensions/algebra. For now there is only Vector concept and some algorithms (for now only for vectors defined in cartesian cs). Basically this is what is implemented now:
typedef bg::model::point<
double, 3, ::boost::geometry::cs::cartesian> p3d;
typedef bg::model::box<p3d> b3d;
typedef ag::model::vector<double, 3> v3d;
v3d v;
bg::set<0>(v, 1);
bg::set<1>(v, 2);
bg::set<3>(v, 3);
double x = bg::get<0>(v);
double y = bg::get<1>(v);
double z = bg::get<2>(v);
bg::assign_values(v, 10, 11, 12);
bg::assign_zero(v);
// get vector
p3d p1, p2;
bg::translation(p1, p2, v);
v = bg::return_translation<v3d>(p1, p2);
// translate point
bg::translate(p1, v);
bg::translated(p1, v, p2);
p2 = bg::return_translated<p3d>(p1, v);
// translate box
b3d b1, b2;
bg::translate(b1, v);
bg::translated(b1, v, b2);
b2 = bg::return_translated<b3d>(b1, v);
I was probably too hasty with the rotation proposal and must think more about it.
Another thing, if we have transformations in the future, it would probably be good to replace translate() and rotate() with one transform() function working for vectors, rotation and transformation matrices, quaternions, etc.
And then replace translation() by some more general name like vector_between().
Regards,
Adam
_______________________________________________
Geometry mailing list
Geometry@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/geometry