Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] graham_andrew_scan() problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] graham_andrew_scan() problem


Chronological Thread 
  • From: Panagiotis Cheilaris <>
  • To:
  • Subject: Re: [cgal-discuss] graham_andrew_scan() problem
  • Date: Sun, 19 Jan 2014 12:01:45 +0200

On Sat 2014-01-18 at 23:25:42 +0100, Alessandro Attanasi wrote:
> Hi,
> I'm not understanding the behaviour of the graham_andrew_scan()
> what should I expect if I have the following points?
>
> q7
> q4
> q1 q2 q3
> q5
> q6
>
> q1 (-1,0)
> q2 (0,0)
> q3 (1,0)
> q4 (2,1)
> q5 (2,-1)
> q6 (1.5,-2)
> q7 (1.5,2)
>
> I filled a std::vector<Point_2> scan_test with this points in the order
> given by the numbers above, then I called
>
> CGAL::graham_andrew_scan(scan_test.begin(),scan_test.end(),std::back_inserter(scan_result));

Hi Alessandro,

First of all, I think there is no graham_andrew_scan but only
ch_graham_andrew_scan. Please check this. As a general remark,
whenever you have a problem, you could send a minimal example
of code that compiles and when run gives your claimed output.

> being std::vector<Point_2> scan_result.
>
> And as result I obtained
>
> q1,q3,q4 into scan_result. Why?

I think ch_graham_andrew_scan requires the input vector of
points to be somehow sorted and your input is not.
I think you should sort the points with Less_xy_2.

What did you expect to get?

Best,
Panos



Archive powered by MHonArc 2.6.18.

Top of Page