In shaders,how to calculute terrain or ellipsoid coordinates from world coordinates

Is there a function in the Cesium built-in shader library to calculate terrain or ellipsoid coordinates from world coordinates?