for part two
is the vector is parallel to the xy plane it is perpendicular to the z axis
again let <x,y,z> be any vector so we know that
so we get
To make this a unit vector divide each component of the vector by the vectors magnitude!