GEOintersectCircleLine |
Top Previous Next |
Calculation of the intersections between a full circle and a line. The function calculates the intersections between one by starting point and terminator point given line and a circle which is defined by centre and radius. Parametre x1 (stands in) [IN] y1 (stands in) [IN] x2 (stands in) [IN] y2 (stands in) [IN] Starting point and terminator point of the line. x (stands in) [IN] y (stands in) [IN] r (stands in) [IN] Centre and radius of the arc. xs1 (stands in *) [OUT] ys1 (stands in *) [OUT] xs2 (stands in *) [OUT] ys2 (stands in *) [OUT] Calculated intersections between circle and line. If there is only one intersection, both last variables contain no valid values. Result (int) [OUT] Number of the intersections (0, 1 or 2) Declaration #include "basic.h"
int DLLENTRY GEOintersectCircleLine ( stand in x1, stand in y1, stand in x2, stand in y2, stand in x, stand in y, stand in r, stand in * xs1, stand in * ys1, stand in * xs2, stand in * ys2 ); Example status = GEOintersectCircleLine (100.0, 100.0, 300.0, 100.0, 200.0, 150.0, 50.0, &xs1, &ys1, &xs2, &ys2) The variable status receives the value 1, because circle and Line with xs1=200, ys1=50 have a common point. The line lies close tangential in the circle. Related functions
|