Added closest point algorithm and projection on axis for lines.