This question already has an answer here:

Which two points are we talking about in Fermat's principle? Are those points decided by light or decided by us? Can we take any two points?


marked as duplicate by John Rennie visible-light May 2 '18 at 5:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Hi Kiran. While the question I have linked is a duplicate it's quite technical and you my find it impenetrable. If so ping me here and I'll reopen this question so someone can add a simpler answer. $\endgroup$ – John Rennie May 2 '18 at 5:06
  • $\begingroup$ Fermat's principle states that given any two points $P$ and $Q$ between which there is a ray then the optical path length defined by $[OPL]= \int_{P}^{Q}nds$ is extremum among all neighboring paths connecting the fixed points $P$ and $Q$. $\endgroup$ – hyportnex May 2 '18 at 14:45