function interpolateAndAssignHeight(position, terrainData, rectangle) {
  const height = terrainData.interpolateHeight(
    rectangle,
    position.longitude,
    position.latitude,
  );
  if (height === undefined) {
    // if height comes back as undefined, it may implicitly mean the terrain data
    //  requires us to call TerrainData.createMesh() first (ArcGIS requires this in particular)
    //  so we'll return false and do that next!
    return false;
  }
  position.height = height;
  return true;
}
Calls {@link TerrainData#interpolateHeight} on a given {@link TerrainData} for a given {@link Cartographic} and
 will assign the height property if the return value is not undefined.

If the return value is false; it's suggesting that you should call {@link TerrainData#createMesh} first.
@param {Cartographic} position The position to interpolate for and assign the height value to
@param {TerrainData} terrainData
@param {Rectangle} rectangle
@returns {boolean} If the height was actually interpolated and assigned
@private