E-Code

Thin lens, mirror, lensmaker and two-lens system — a TI-84 Plus CE program

By E-Code · updated

LENS is a TI-BASIC program for the TI-84 Plus CE. Thin lens or mirror (1/f = 1/do + 1/di; real is positive — f > 0 for a converging lens or concave mirror, di < 0 means virtual, negative magnification means inverted): image distance, magnification, image height and real/virtual, upright/inverted; the lensmaker's equation for a lens in air with power in diopters (R > 0 for a surface convex toward the object: biconvex R1 > 0, R2 < 0); and a two-lens system with total magnification and equivalent focal length.

What it asks for and what it shows

It asks for 3 values at its prompts, after you pick option 1 from its menu. In the example below it shows DI CM, MAG, HI CM, REAL, INVERTED, REDUCED.

Example run

One of its oracle test cases: “converging lens, object beyond 2F”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Menuoption 1
Input 110
Input 230
Input 32
The screen shows
DI CM=15
MAG=-0.5
HI CM=-1
TextREAL
TextINVERTED
TextREDUCED

How it's checked

8 test cases, each checked against an independent method. Replayed key by key on a virtual TI-84 Plus CE, they make 51 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-84 Plus CE physics programs · All TI-84 Plus CE programs