Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Coordinate Transformation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Coordinate Transformation


Chronological Thread 
  • From: "Max" <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] Coordinate Transformation
  • Date: Thu, 17 Jan 2008 18:55:16 +0800
  • Disposition-notification-to: "Max" <>
  • Organization: LoadCom

Sorry, the line
return CGAL::Aff_transformation_3<Kernel>
should be
return CGAL::Aff_transformation_3<typename Vector_3::R>
>Hello
>
>I need to do some coordinates transformation between severl 3d coordinate
>frames. At first I wrote the following code to do the transformation,
>
>template<typename Vector_3>
>CGAL::Aff_transformation_3<typename Vector_3::R> MakeUserCoordSysFromVectors(
> const Vector_3& x, const Vector_3& y, const Vector_3& z )
>{
> // make a transformation from global/default coord system
> // to the user/local system specified by the x/y/z *UNIT*
> // vectors denoting the user system's x/y/z axis
> return CGAL::Aff_transformation_3<Kernel>
> (x.x(), x.y(), x.z(),
> y.x(), y.y(), y.z(),
> z.x(), z.y(), z.z());
>}
>
>but I got a compiler error. To have the code compiled, I changed the code
>to this:
>
>template<typename Vector_3>
>CGAL::Aff_transformation_3<typename Vector_3::R> MakeUserCoordSysFromVectors(
> const Vector_3& x, const Vector_3& y, const Vector_3& z )
>{
> return CGAL::Aff_transformation_3<Kernel>
> (CGAL::to_double(x.x()), CGAL::to_double(x.y()),
> CGAL::to_double(x.z()),
> CGAL::to_double(y.x()), CGAL::to_double(y.y()),
> CGAL::to_double(y.z()),
> CGAL::to_double(z.x()), CGAL::to_double(z.y()),
> CGAL::to_double(z.z()));
>}
>
>yes, it got compiled and worked ok. But I think it's not good enough -
>for any exact kernel, an conversion to double and then back may lose
>the should-have exactness. How to get rid of this drawback? Is there
>any other solution more elegant?
>
>Thanks for any help.
>
>B/Rgds
>Max
>--
>You are currently subscribed to cgal-discuss.
>To unsubscribe or access the archives, go to
>https://lists-sop.inria.fr/wws/info/cgal-discuss
>



Archive powered by MHonArc 2.6.16.

Top of Page