formZ SDK | 5.0 API Reference | System | Math
Description
Calculates the shortest distance between two 3d lines in 3d space.
The two 3d points, where the shortest distance occurs are also returned
(pt1 on line 1 and pt2 on line 2).
If the two lines lie in the same plane pt1 and pt2 are the same.
If the two lines are parallel, pt1 is line1_start and pt2 is
the perpendicular projection of pt1 on line 2.
How the two lines relate in 3d is returned in the kase parameter.
0 : lines don't intersect in one point and are not parallel
1 : lines intersect in one point and are not parallel (i.e. dist = 0.0 and pt1 == pt2)
2 : lines are parallel (dist is constant between the lines, pt1 and pt2 chosen arbitrarily)
Plugin Prototype
fzrt_error_td fz_math_3d_dist_2_lines(
line1_start, | |
line1_end, | |
line2_start, | |
line2_end, | |
double * | dist, |
pt1, | |
pt2, | |
fzrt_int * | kase ) |
Parameters
line1_start [Input]
start point of 3d line segment 1
line1_end [Input]
end point of 3d line segment 1
line2_start [Input]
start point of 3d line segment 2
line2_end [Input]
end point of 3d line segment 2
dist [Result, Optional]
shortest distance between the lines
pt1 [Result, Optional]
3d point on line segment 1 where the shortest distance occurs
pt2 [Result, Optional]
3d point on line segment 2 where the shortest distance occurs
kase [Result, Optional]
how the line segments relate
Returns
Error codes
Availability
5.0.0.0
Example Files
Function Set
Defined in