2D and 3D inline functions