GEOintersectCircleCircle |
Top Previous Next |
Calculation of the intersections between two circles. The function calculates the intersections between two circles which are defined by centre and radius. Parametre c1x (const stands in) [IN] c1y (const stands in) [IN] r1 (const stands in) [IN] Centre and radius of the first circle. c2x (const stands in) [IN] c2y (const stands in) [IN] r2 (const stands in) [IN] Centre and radius of the second circle. s1x (stands in *) [(IN) / OUT] s1y (stands in *) [(IN) / OUT] s2x (stands in *) [(IN) / OUT] s2y (stands in *) [(IN) / OUT] Calculated intersections between both circles. The pointers must point at variable of the type stands in. They are filled with the data of the intersections. If there is only one intersection, remain xs2 and ys2 unchanged if there is no intersection, all 4 variables remain unchanged. If one of the pointers hands over as a zero pointer, this is ignored. Result (int) [OUT] Number of the intersections (0, 1 or 2) Declaration #include "basic.h"
int DLLENTRY GEOintersectCircleCircle ( const stands in c1x, const stands in c1y, const stands in r1, const stands in c2x, const stands in c2y, const stands in r2, stand in * s1x, stand in * s1y, stand in * s2x, stand in * s2y ); Example status = GEOintersectCircleCircle (100.0, 100.0, 300.0, 400.0, 100.0, 500.0, &xs1, &ys1, &xs2, &ys2) The variable status receives the value 2, because the circles cut themselves in two points (xs1=100, ys1=400; xs2=100, ys2 =-200). Related functions
|