formZ SDK | 5.0 API Reference | System | Math

fz_math_2d_dist_pt_line_seg

Description

Calculates the perpendicular distance from a 2d point to a 2d line segment (defined by it's start and end points).
The line segment is thought to extend infinitely.

Plugin Prototype

fzrt_error_td fz_math_2d_dist_pt_line_seg(

fz_xy_td *

line_start,

fz_xy_td *

line_end,

fz_xy_td *

pt,

double *

dist )

Parameters

line_start [Input]

start point of 2d line segment

line_end [Input]

end point of 2d line segment

pt [Input]

2d point

dist [Result]

distance from point to line segment

Returns

Error codes

Availability

5.0.0.0

Example Files

util_math_2d.fsl

See Also

fz_math_2d_dist_pt_line_equ,

Function Set

fz_math_fset


Defined in

fz_math_api.h