int sds_inters (const sds_point point1, const sds_point point2, const sds_point point3, const sds_point point4, int mode, sds_point interspt);
Find where these lines intersect.
This function finds the intersection point of two lines.
The arguments point1 and point2 represent the starting and ending points for the first line segment, while point3 and point4 are the starting and ending points for the second line segment.
The mode argument controls whether the line segments must actually cross:
The lines do not need to cross.
The lines must cross.
When mode is 1 and the line segments do not intersect, sds_inters returns RTERROR.
The interspt argument is the point at which the two lines intersect.
This function returns RTERROR or RTNORM.
cross = 1;
sds_getpoint(NULL,"\nFirst point for line 1: ",firstpt);
sds_getpoint(firstpt,"\nSecond point: ",secondpt);
sds_getpoint(NULL,"\nFirst point for line 2: ",thirdpt);
sds_getpoint(thirdpt,"\nSecond point: ",fourthpt);
if (returni != 5100)
sds_printf("\nThese two line segments do not intersect");
if (returni == 5100)
sds_printf("\nIntersection: (%f,%f,%f)", intpt,intpt,intpt);
Tell me about...
Programming Overview of SDS (Solutions Development System)