E-Code

Refraction: Snell's law and total internal reflection — a TI-84 Plus CE program

By E-Code · updated

SNELL is a TI-BASIC program for the TI-84 Plus CE. Light going from index n1 into n2 at an angle (measured from the normal): the refracted angle, or TOTAL INTERNAL REFLECTION when it can't get out, the critical angle when n1 > n2, and the speed of light in the second medium.

What it asks for and what it shows

It asks for 3 values at its prompts. In the example below it shows OUT DEG, V2 M/S.

Example run

One of its oracle test cases: “air into water at 30 degrees”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Input 11
Input 21.333
Input 330
The screen shows
OUT DEG=22.03010873
V2 M/S=224900568.6

How it's checked

4 test cases, each checked against an independent method. Replayed key by key on a virtual TI-84 Plus CE, they make 18 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