Package lib :: Package geometry :: Module lines
[hide private]
[frames] | no frames]

Module lines

source code

Functions relating to line geometry.

Functions [hide private]
numpy rank-1 array
closest_point(line_pt1=None, line_pt2=None, point=None)
Determine the closest position on the line to the given point.
source code
numpy rank-1 array
closest_point_ax(line_pt=None, axis=None, point=None)
Determine the closest position on the line to the given point.
source code
Variables [hide private]
  __package__ = 'lib.geometry'

Imports: dot, norm


Function Details [hide private]

closest_point(line_pt1=None, line_pt2=None, point=None)

source code 

Determine the closest position on the line to the given point.

This function defines the line using any two points on the line.

Parameters:
  • line_pt1 (numpy rank-1 array) - The first point defining the line.
  • line_pt2 (numpy rank-1 array) - The second point defining the line.
  • point (numpy rank-1 array) - The point.
Returns: numpy rank-1 array
The position on the line closest to the point.

closest_point_ax(line_pt=None, axis=None, point=None)

source code 

Determine the closest position on the line to the given point.

This function defines the line using any point on the line and the axis.

Parameters:
  • line_pt1 (numpy rank-1 array) - The point defining the line.
  • axis (numpy rank-1 array) - The axis defining the line.
  • point (numpy rank-1 array) - The point.
Returns: numpy rank-1 array
The position on the line closest to the point.