Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] print_polygon

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] print_polygon


Chronological Thread 
  • From: "K.M" <>
  • To:
  • Subject: Re: [cgal-discuss] print_polygon
  • Date: Thu, 06 Sep 2007 16:43:06 +0900

Hi Martin,

Thanks for quick reply. to_double() works fine.

Kenji

> The function
>
> CGAL::to_double()
>
> converts CGAL exact number types to doubles.
>
> Martin.
>
> > Hi Efi,
> >
> > > p.x() and p.y() return the Cartesian /x/-coordinate and the Cartesian
> > > y-coordinate of a point p respectively.
> > > p.hx(), p.hy(), and p.hw() return the homogeneous /x/-coordinate, the
> > > homogeneous y-coordinate, and the homogenizing coordinate respectively.
> > > //
> >
> > Thanks for reply.
> > As you suggested, hx()/hy() function works. But its output is hx/hw format
> > even on x()/y() function like -1/1, 5/4 shown below.
> > There is example code and result.
> >
> > I would like to get x/y coordinate with integer or double type variable.
> > Let me know any suggestion.
> >
> > === Example Code ===
> > #include "bso_rational_nt.h"
> > #include <CGAL/Cartesian.h>
> > #include <CGAL/Boolean_set_operations_2.h>
> > struct Kernel : public CGAL::Cartesian<Number_type> {};
> >
> > typedef Kernel::Point_2 Point_2;
> >
> > int main ()
> > {
> > Point_2 A(-1, 1.25);
> > std::cout << "A = (" << A.hx() << ":" << A.hy() << ")" << std::endl;
> >
> > return 0;
> > }
> >
> > == Result ==
> > A = (-1/1:5/4)
> >
> > Kenji
> > --




Archive powered by MHonArc 2.6.16.

Top of Page