project_onto function

Closest point on a given flat