formZ SDK | 5.0 API Reference | System | Math

# fz_math_3d_isect_line_sphere

Description

Calculates the intersection of a line segment (defined by it's start and end points) with a sphere (defined by a center and radius).
Note : int_pts must be an array that can hold two 3d points. n_int_pts wil be returned as either 0, 1 or 2 and indicates how many points are stored in int_pts.

Plugin Prototype

fzrt_error_td fz_math_3d_isect_line_sphere(

fz_xyz_td * | line_start,
fz_xyz_td * | line_end,
fz_xyz_td * | center,
double | radius,
fz_xyz_td | int_pts[2],
fzrt_int * | n_int_pts )

Parameters

line_start [Input]

start point of 3d line segment

line_end [Input]

end point of 3d line segment

center [Input]

center of the sphere

radius [Input]

radius of the sphere

int_pts[2] [Result]

intersecting 3d points array

n_int_pts [Result]

number of intersecting points

Returns

Error codes

Availability

5.0.0.0

Example Files

util_math_3d.fsl

See Also

fz_math_3d_isect_line_plane, fz_math_3d_isect_line_cube, fz_math_3d_isect_lines, , fz_math_3d_isect_3_planes, fz_math_3d_isect_2_planes

Function Set

fz_math_fset

Defined in

fz_math_api.h