As Rainbow2, the optical path is calculated dynamically using the Snell law for refraction (geometrical way). In this case the path is relative to the secondary rainbow (reversed colors). Full description document available at: https://drive.google.com/file/d/0B46kIc2y96X7YUVTaWNBTk5aZWs/view?usp=sharing
Adjust sliders for blue and red refraction index. Light ray arrives from below (point C)