Converting rectangular to polar coordinates
You miss the simple fact that a circle is 360° periodic. Your result is correct:
360°-14.66° = 345.34°.
Thus you miss that the arctan usually returns -180...+180° and you don't correct for the fact that the longitude is positive defined in the range of 0 ... 360°. Thus add +360° when your result is negative.