Constructing a unit normal vector to a curve