945{
946 int intersections = 0;
949
950 assert(on_boundary);
951
952
954 lwerror(
"%s called on invalid circularstring", __func__);
955
957 lwerror(
"%s called with even number of points", __func__);
958
959
960 for (uint32_t i = 1; i < pa->
npoints-1; i +=2)
961 {
966 double radius, d;
968
969
971 continue;
972
973
975 {
977 return 0;
978 }
979
980
982
985 {
987 return 0;
988 }
989
990
991
992
994 if ((gbox.
ymin <= py) && (py < gbox.
ymax))
995 {
996
998
999
1001
1002
1003 if (iCount == 0)
1004 continue;
1005
1006
1007
1008 if (iCount == 1)
1009 continue;
1010
1011
1012
1013
1015 intersections++;
1016
1018 intersections++;
1019 }
1020 }
1021
1022 return intersections;
1023}
int lw_arc_calculate_gbox_cartesian_2d(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, GBOX *gbox)
double distance2d_pt_pt(const POINT2D *p1, const POINT2D *p2)
#define LW_TRUE
Return types for functions with status returns.
double lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D *result)
Determines the center of the circle defined by the three given points.
int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3)
Returns true if arc A is actually a point (all vertices are the same) .
int lw_pt_in_arc(const POINT2D *P, const POINT2D *A1, const POINT2D *A2, const POINT2D *A3)
Returns true if P is on the same side of the plane partition defined by A1/A3 as A2 is.
int p2d_same(const POINT2D *p1, const POINT2D *p2)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static int circle_raycast_intersections(const POINT2D *center, double radius, double ray, POINT2D *i0, POINT2D *i1)
Calculates the intersection points of a circle and a horizontal line.