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: Martin Baeker <>
  • To:
  • Subject: Re: [cgal-discuss] print_polygon
  • Date: Thu, 6 Sep 2007 08:55:50 +0200 (CEST)
  • Organization: Institut fuer Werkstoffe TU Braunschweig

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
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>

Priv.-Doz. Dr. Martin Bäker
Institut für Werkstoffe
Technische Universität Braunschweig
Langer Kamp 8
38106 Braunschweig
Germany
Tel.: 00-49-531-391-3073
Fax 00-49-531-391-3058
e-mail
<>





Archive powered by MHonArc 2.6.16.

Top of Page