boostorg / polygon

Boost.org polygon module
http://boost.org/libs/polygon
57 stars 70 forks source link

What is `circle_event.lower_x`? #53

Open lycantropos opened 3 years ago

lycantropos commented 3 years ago

I'm trying to understand the algorithm (btw if there is a formal description -- will be glad to read it) and want to understand what is circle_event.lower_x field, I understand that circle_event class represents circle built during sweeping the plane and from docstring I can see that

lower_x_ - leftmost x-coordinate;

For example, if we have a circle image does this point has coordinates (lower_x, center_y) or am I missing something?

If lower_x is the lefmost should it be always to the left of the center_x?

eadf commented 3 years ago

lower_x is the x coordinate of the circle event plus the radius. It is used for sorting events in the correct order. Events are processed left to right, i.e low x value first -> higher x value has lower priority. So I guess the 'lower' part of the name refer to the priority, not the value.