Lens and rays

Lens and rays preview
remixableManimCEmanim-physics2Doptics

manim/lens_rays.py

"""Lens and rays: three parallel rays brought to a focus, and the focus moved.

Render (the driver does this for every palette; these are for eyeballing):
    P=/opt/homebrew/opt/python@3.11/bin/python3.11
    ASSET_MODE=still  $P -m manim -s -t -r 1600,1600 manim/lens_rays.py LensRays
    ASSET_MODE=motion $P -m manim -qh   -r 1080,1080 manim/lens_rays.py LensRaysLoop
"""

import numpy as np
from manim import (
    DOWN,
    LEFT,
    RIGHT,
    UP,
    DashedLine,
    Dot,

The full Manim source and the rendered video come with a plan.