def vector_to_axis(line, point):
 line = line.normalized()
 np = point.norm()
 angle = line.angle(point)
 return (point - (line ** (np * numpy.cos(angle))))

def vector_to_axis ( line , point ) : line = line . normalized ( ) np = point . norm ( ) angle = line . angle ( point ) return ( point - ( line ** ( np * numpy . cos ( angle ) ) ) )
returns the vector between a point and the closest point on a line .