Light travels in a straight line (rectilinear propagation of light). T

Light travels in a straight line (rectilinear propagation of light). This statement does hold if the medium of travel for light is

of variable refractive index
made up of slabs of different refractive indices
homogeneous and transparent
inhomogeneous and transparent
This question was previously asked in
UPSC CDS-2 – 2016
Light travels in a straight line in a homogeneous and transparent medium. A homogeneous medium is one where the refractive index is constant throughout. Transparency allows light to pass through.
Rectilinear propagation of light, or the principle that light travels in straight lines, is a fundamental concept in ray optics and holds true when the medium is uniform and has a constant optical density (homogeneous) and allows light to pass through (transparent).
If the medium has a variable refractive index (A) or is made of different slabs with different refractive indices (B), light will bend (refract) as it moves through the medium or crosses boundaries between regions. An inhomogeneous medium (D) also implies a varying refractive index, causing light to not travel in a straight line.