Source files available here

Load packages

Shape of error function

Note: goes to zero as \(t\) approaches \(\pi/2\), because ray-trace path is shrinking.

Optimization functions

Calculate optimum \(\theta\) for this triangle

Investigate optimum \(\theta\) for various values of \(t\) from -90 to 0 degrees

Some values are causing minimizer to be unstable

Values are between 8 and 9 degrees

Orbit perimeter is constant but area is not

Fixed point on boundary, vary output angle wrt normal

Calculate incenter locus

Note: 150 degrees base vertex motion sweeps 360

Compute / retrieve incenter locus as data frame

Show orbit triangle

Compute animation

Save frames to files

Combine frames into animated .gif