GEOintersectLineLine |
Top Previous Next |
Calculation of the intersection of two distances. With this function is calculated the intersection of the two distances which are given by her starting points and terminator points. If the intersection of the lines on one lies or on both lengthening so this is also calculated. All parametres whose values are not needed may be booked with zero pointers. The difference between cut on the lengthening and in parallel is to be reached only by evaluating the remaining parametres. These are not changed if both distances run in parallel. Parametre x1 (stands in) [IN] y1 (stands in) [IN] x2 (stands in) [IN] y2 (stands in) [IN] Starting point and terminator point of the first line x3 (stands in) [IN] y3 (stands in) [IN] x4 (stands in) [IN] y4 (stands in) [IN] Starting point and terminator point of the second line xs (stands in *) [OUT] ys (stands in *) [OUT] Calculated intersection of both lines. s12 (stands in *) [OUT] The factor by which the vector (x1, y1) - >(x2, y2) must be multiplied to reach to the intersection. s34 (stands in *) [OUT] The factor by which the vector (x3, y3) - >(x4, y4) must be multiplied to reach to the intersection. Result (int) [OUT] 1 Intersection lies on both lines 0 Intersection beyond the lines or it gives no intersection. Declaration #include "basic.h"
int DLLENTRY GEOintersectLineLine ( stand in x1, stand in y1, stand in x2, stand in y2, stand in x3, stand in y3, stand in x4, stand in y4, stand in * xs, stand in * ys, stand in * s12, stand in * s34 ); Example status = GEOintersectLineLine (0.0, 0.0, 500.0, 500.0, 50.0, 450.0, 350.0, 150.0, &xs, &ys, &s12, &s34) The variable status receives the value 1, i.e. the lines cut themselves in the point xs=250, ys=250. status = GEOintersectLineLine (0.0, 0.0, 150.0, 150.0, 50.0, 450.0, 350.0, 150.0, &xs, &ys) The variable status receives the value 0, i.e. the intersection is enclosed in (or both) lengthening xs=250, ys=250. status = GEOintersectLineLine (0.0, 0.0, 500.0, 500.0, 50.0, 150.0, 300.0, 400.0, &xs, &ys) The variable status receives the value 0, i.e. the lines do not cut themselves, because they are parallel. Related functions
|