formZ SDK | 5.0 API Reference | System | Math

# fz_math_2d_equ_from_perp_line

Description

Given a 2d line segment (defined by it's start and end points) and a start/end flag (at_start), calculates the 2d line equation (defined by it's slope and offset) of a perpendicular line at the line start or end point.
The optional kase parameter returns whether the line is horizontal (1), vertical (2) or at an arbitrary angle (0).

Plugin Prototype

fzrt_error_td fz_math_2d_equ_from_perp_line(

fz_xy_td * | line_seg_start,
fz_xy_td * | line_seg_end,
fzrt_boolean | at_start,
double * | line_equ_a,
double * | line_equ_c,
fzrt_int * | kase )

Parameters

line_seg_start [Input]

start point of 2d line segment

line_seg_end [Input]

end point of 2d line segment

at_start [Input]

if TRUE, the perpendicular line is at the start point of the line segment, otherwise the perpendicular line is at the end point of the line segment

line_equ_a [Result]

slope of perpendicular 2d line equation

line_equ_c [Result]

offset of perpendicular 2d line equation

kase [Result, Optional]

information about the line

Returns

Error codes

Availability

5.0.0.0

Example Files

util_math_2d.fsl

Function Set

fz_math_fset

Defined in

fz_math_api.h