Showing posts with label light. Show all posts
Showing posts with label light. Show all posts

Saturday, June 7, 2025

TI-84 Plus CE: Birefringence

TI-84 Plus CE: Birefringence


Introduction


Essentially, birefringence is the double refraction of light in material, drive by the differences in the refractive indices of both materials. Mathematically, birefringence between two materials is defined as:


B = | n_e – n_o |


n_o: refractive index of light where the ordinary ray originates

n_e: refractive index of light where the extraordinary ray originates


If n_e > n_o, we have positive birefringence, and the wave polarizes quickly.

If n_e < n_o, we have negative birefringence, and the wave polarizes slowly.


The relative retardation (delay or angle in radians) with one ray respected to another is calculated by the equation:


R = T * B


T = the thickness of the material, typically in meters



The program features 10 common materials, with the 11th allowing the user to enter their own refractive index, particularly useful for crystals.



TI-84 Plus CE Program: BIREF


Full

{1,1.000293,1.000132,1.333,1.31,1.46,1.49,1.52,1.69,2.417}→L₁

“ORDEXT”→Str0


For(I,1,2)

ClrHome

Output(9,1,"BIREFRINGENCE")

Output(3,1,"1. VACUUM")

Output(4,1,"2. AIR")

Output(5,1,"3. HYDROGEN")

Output(6,1,"4. WATER")

Output(7,1,"5. ICE")

Output(3,12,"6. QUARTZ")

Output(4,12,"7. PLEXIGLASS")

Output(5,12,"8. WINDOW GLASS")

Output(6,12,"9. FLINT GLASS")

Output(7,12,"10. DIAMOND")

Output(8,12,”11. YOUR OWN”)

Input sub(Str0,3(I-1)+1,3)+” RAY? ”,J


If J=11:Then:

Input “ENTER REF INDEX: “,X

If I=1:Then:X→O

Else:X→E:End

Else

If I=1:Then:L₁(J)→O

Else:L₁(J)→E:End

End

End


Input "THICKNESS? ",T

abs(E-O)→B

T*B→G


ClrHome

If E≥O:Then:Disp "POSITIVE"

Else:Disp "NEGATIVE":End

Disp "BIREFRINGENCE:",B,"DELAY:",G


Note: The Full mode sets the TI-84 to full screen mode.



Examples


Example 1: Diamond (ordinary ray) to Air (extraordinary ray), 0.5 m thick

Negative Birefringence: 1.416707

Delay: 0.7083535 (radians)



Example 2: Air (ordinary ray) to Ice (extraordinary ray), 3.6 m deep


Positive Birefringence: 0.309707

Delay: 1.1149452 (radians)



Sources


Nikon with contributing authors Douglas B. Murphy, Kenneth R. Spring, Thomas J. Fellers, and Michael W. Davidson. “Principles of Birefringence: Introduction to Optical Birefringence” Nikon. MicroscopyU: The Source for Microscopy Education. 2024/2025. Retrieved November 16, 2024. https://www.microscopyu.com/techniques/polarized-light/principles-of-birefringence#:~:text=Birefringence%20is%20formally%20defined%20as,dependent%20differences%20in%20refractive%20index.


“Refractive index.” Wikipedia https://en.wikipedia.org/wiki/Refractive_index At the time of retrieval, it was edited November 17, 2024. Retrieved December 1, 2024.



Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Sunday, April 16, 2023

Python and Casio fx-4000P: Transmission and Deviation Angles - Prism

Python and Casio fx-4000P:   Transmission and Deviation Angles - Prism




Celebrating 12 Years in the Blogopshere!   Thank you to my readers, subscribers, and everyone who has stopped by during the years!  




Introduction


Today's program calculates the transmission and deviation angles passing through a prism.   The refractive index of the prism is determined by the material it is made of.   





Formulas Used for the transmission and deviation angles, respectively:


θt = arcsin( α * √(n^2 - sin^2 θi) - sin θi * cos α)


δ = θi + θt - α


The Python program calculates for prisms made of acrylic, glass, fluorite, and plastic.  



Python Script:  prism.py


Program Notes:


1.  The angle mode in Python is always radian angle mode. Conversions between degrees and radians are necessary on this code.


2.  This code was programmed with a Casio fx-9750GIII in the Python app.   I could have used the degrees and radians functions, however, they were not present in the calculator's catalog.  


3.  I used a While loop and initialized the choice variable k as -1 to prevent the user from choosing anything from picking outside the range 0-3.  This simulates the Menu command in Casio graphing calculator programming.


4. The refractive indices are average and approximate.  


5. To make everything fit on the screen, the new line escape character, \n, is used.  


Code:


from math import *

# radians mode

print("Enter in Degrees")

i=float(input("Incidence Angle? \n"))

a=float(input("Top Angle? \n"))


# convert to radians

ir=i*pi/180

ar=a*pi/180


# choice of material

# refractive index

ls=[1.4905,1.52,1.433,1.58]

k=-1

while k<0 or k>3:

  print("Select Material")

  print("0. Acrylic")

  print("1. Glass")

  print("2. Fluorite")

  print("3. Plastic")

  k=int(input())

n=ls[k]


# calculation

t=asin(sin(ar)*sqrt(n**2-sin(ir)**2)-sin(ir)*cos(ar))

d=ir+t-ar


# convert to degrees

td=t*180/pi

dd=d*180/pi


# results

print("Results are in Degrees")

print("Transmission Angle: \n"+str(td))

print("Deviation: \n"+str(dd))



Casio fx-4000P Program:  Prism


Notes:


1.  Variables used:

I = incidence angle

A = top angle of the prism

N = refractive index, must be entered manually


2.  Outputs:

Transmission Angle (T)

Deviation Angle (D)


Code:

(59 steps)


Deg :

"I": ?→ I:

"A": ?→A:

"N": ?→N:

sin⁻¹ ( sin A × √( N² - (sin I)²) - sin I × cos A) → T ◢

I + T - A → D



Examples


I = incidence angle

A = top angle of the prism

T = Transmission Angle

D = Deviation Angle



1.  I = 50°, A = 60°,  Glass (1.52)


T ≈  48.932708276°

D ≈ 38.932708276°


2.  I = 10°, A = 45°, Plastic (1.58)


T ≈ 80.99437617°

D ≈ 45.99437617°


3.  I = 33°, A = 25°,  Acrylic (1.4905)


T ≈ 5.32137979°

I ≈ 13.32137979°


4.  I = 17°, A = 40°, Fluorite (1.433)


T ≈ 42.66957975°

I ≈ 19.66957975°



Source


Woan, Graham.  The Cambridge Handbook of Physics Formulas  Cambridge University Press.  Cambridge, New York.  2003 edition



Here is to many more years, 


Eddie 


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, December 4, 2022

Casio fx-CG 50: Fresnel's Equations - Polarized Light

Casio fx-CG 50:  Fresnel's Equations - Polarized Light



Introduction:  Reflection and Transmission


The object of Fresnel's Equations is to calculate the reflection and transmissions of a light wave when it hits a change of medium.   Where the change of medium occurs is known as of a plane of incidence.  The equations calculate components:  p-polarized light for light parallel to the plane of incidence, and s-polarized light for perpendicular to the plane of incidence.  


The program presented also calculates Brewster's Angle, the angle required for light to hit the plane of incidence to have no reflection.  


Simplified, the equations are:


Angle of Transmission per Snell's Law:


Θt = arcsin(n1 × sin Θi ÷ n2)


Reflection Coefficients:


r ∥ = tan(Θi - Θt) ÷ tan(Θi + Θt) 


r ⟂ = -sin(Θi - Θt) ÷ sin(Θi + Θt) 


Transmission Coefficients:


t ∥ = (2 × sin Θt × cos Θi) ÷ (sin(Θi + Θt) × cos(Θi - Θt))


t ⟂ = (2 × sin Θt × cos Θi) ÷ sin(Θi + Θt)


Brewster's Angle:


Θb = arctan(Θt ÷ Θi)



Casio fx-CG 50 Program:  POLARIZE

(284 bytes)


Text file:


'ProgramMode:RUN

"2022-10-19 EWS"

Deg

"REFRACT INDEX 1"?->M

"_Theta_I"?->P

"REFRACT INDEX 2"?->N

"_Theta_T"

sin^-1 (M*sin P/N)->QDisps

"REFLECTION:"

"R_#E6D7_:"

tan (P-Q)/tan (P+Q)->RDisps

"R_#E6D5_:"

(-)sin (P-Q)/sin (P+Q)->TDisps

"TRANSMISSION:"

"T_#E6D7_:"

(2*sin Q*cos P)/(sin (P+Q)*cos (P-Q))->SDisps

"T_#E6D5_:"

(2*sin Q*cos P)/sin (P+Q)->UDisps

"BREWSTERS ANGLE:"

tan^-1 (N/M)->B


Program Code:


"2022-10-19 EWS"

Deg

"REFRACT INDEX 1"?→M

"ΘI"?→P

"REFRACT INDEX 2"?→N

"ΘT"

sin^-1 (M*sin P/N)→Q ◢

"REFLECTION:"

"R∥:"

tan (P-Q)/tan (P+Q)→R ◢

"R⟂:"

-sin (P-Q)/sin (P+Q)→T ◢

"TRANSMISSION:"

"T∥:"

(2*sin Q*cos P)/(sin (P+Q)*cos (P-Q))→S ◢

"T⟂:"

(2*sin Q*cos P)/sin (P+Q)→U ◢

"BREWSTERS ANGLE:"

tan^-1 (N/M)→B


The symbols ∥ and ⟂ are from the CHAR menu.  


Examples


All angles are in degrees.  


Example 1:


Inputs:

n1 = 1.00293 

ΘI = 20

n2 = 1.52 (glass)


Results:

ΘT = 13.04242914

R∥ = 0.1876099408

R⟂ = -0.2221588123

T∥ = 0.7836116039

T⟂ = 0.7778411877

Brewster's Angle = 56.58227879


Example 2:


Inputs:

n1 = 1.000293 (air)

ΘI = 34

n2 = 1.333 (water)


Results:

ΘT = 24.81075448

R∥ = 0.09793113211

R⟂ = -0.1866780705

T∥ = 0.8238955934

T⟂ = 0.8133219295

Brewster's Angle = 53.11516797



Sources


"Brewster's Angle".  Wikipedia.  https://en.wikipedia.org/wiki/Brewster%27s_angle  Retrieved October 18, 2022


"Fresnel's Equations: Reflection and Transmission"  HyperPhysics. http://hyperphysics.phy-astr.gsu.edu/hbase/phyopt/freseq.html  Retrieved October 16, 2022



Until next time,


Eddie


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, January 18, 2020

HP 42S/DM42S/Free42: Atmospheric Refraction

HP 42S/DM42S/Free42: Atmospheric Refraction

Introduction

The program ATREF calculates the atmospheric refraction and the true "airless" altitude of a light from a star or any atmospheric object due to the Earth's atmosphere.   As a result, the true altitude is generally lower than the apparent altitude.

Jean Meeus' "Astronomical Algorithms" (see source below) presents an approximation of calculating refraction by G.G. Bennett (University of New South Wales):

R = 1/(tan h_0 + 7.31/(h_0 + 4.4))

where:

R =  atmospheric refraction, in arc minutes

h_0 = apparent altitude (the altitude you see), in hours-degrees-seconds format (HH.MMSSSS)

True altitude, in hours-degrees-seconds format (HH.MMSSSS) is calculated as:

h = R - h_0


HP 42S/DM42/Free 42 Program ATREF

00 { 74-Byte Prgm }
01▸LBL "ATREF"
02 DEG
03 "APP ALT?"
04 PROMPT
05 STO 00
06 →HR
07 ENTER
08 ENTER
09 4.4
10 +
11 1/X
12 7.31
13 ×
14 +
15 TAN
16 1/X
17 STO 01
18 "REF: "
19 ARCL ST X
20 ├"'"
21 AVIEW
22 STOP
23 100
24 ÷
25 RCL 00
26 X<>Y
27 HMS-
28 "TRUE ALT:"
29 ARCL ST X
30 AVIEW
31 .END.

Example

Input:  h_0:  35'  (35 arcminutes, enter as 0.35)

Output:
REF: 27.9342'  (27.9342 arcminutes)  (R/S)
TRUE ALT:  0.0667   (6.67 arcminutes)
 
Source:

Meeus, Jean.  Astronomical Algorithms.  Willams-Bell Inc:  Richard, VA 1991 ISBN 0-943396-35-2

Eddie

All original content copyright, © 2011-2020.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Friday, December 22, 2017

Optics: Transmitted Angle, Critical Angle

Optics:  Transmitted Angle, Critical Angle



Formulas Used

Reflected Angle:  θr = θ

Transmitted Angel:  θt = asin((n1 * sin θ)/n2)

Critical Angle:  θc = asin(n1/n2),  n2 > n1

Perpendicular Frensel Parameters (t, r):

t = (2 * n1 * cos θ) / (n1 * cos θ + n2 * cos θt)

r = (n1 * cos θ – n2 * cos θt) / (n1 * cos θ + n2 * cos θt)

Parallel Fresnel Parameters (t, r):

t = (2 * n1 * cos θ) / (n1 * cos θt + n2 * cos θ)

r = (n1 * cos θt – n2 * cos θ) / (n1 * cos θt + n2 * cos θ)

Table of Indices of Reflection (n)

Air
1.00
Moissanite (SiC)
2.65
Carbon Dioxide (CO2)
1.0045
Pyrex
1.47
Cubic Zirconia
2.15
Salt (NaCl)
1.54
Diamond
2.42
Sapphire
1.76
Glass
1.52
Silicon
3.45
Ice
1.31
Water
1.33

HP Prime Program FLATOPTIC

EXPORT FLATOPTIC()
BEGIN
// 2017-12-17 EWS
// Solar Energy

// Change to degree
HAngle:=1;

// index of refraction

LOCAL L0:={1,1.0045,2.15,2.42,
1.52,1.31,2.65,1.47,
1.54,1.76,3.45,1.33};

LOCAL L1:={"Air","CO2",
"Cubic Zirconia","Diamond",
"Glass","Ice",
"Moissanite (SiC)","Pyrex",
"Salt (NaCl)","Sapphire",
"Silicon","Water"};

LOCAL L2:={"Perpendicular",
"Parallel",
"None"};

LOCAL n1,n2,k1,k2,θ,t,r;
LOCAL θc,θt,θr,x;

INPUT({{k1,L1},{k2,L1},θ,{x,L2}},
"Optic - Flat Interface",
{"Medium 1: ","Medium 2: ",
"Angle (°): ","Polarized?"}
);

// Calculation
PRINT();

θr:=θ;
PRINT("Reflect Angle: "+θr+"°");

n1:=L0(k1); n2:=L0(k2);
IF n2>n1 THEN
θc:=ASIN(n1/n2);
PRINT("Critical Angle: "+θc+"°");
END;

θt:=ASIN(n1*SIN(θ)/n2);
PRINT("Transmitted Angle: "+
θt+"°");

IF x==1 THEN
t:=(2*n1*COS(θ))/
(n1*COS(θ)+n2*COS(θt));
r:=(n1*COS(θ)-n2*COS(θt))/
(n1*COS(θ)+n2*COS(θt));
PRINT("t: "+t);
PRINT("r: "+r);
END;

IF x==2 THEN
t:=(2*n1*COS(θ))/
(n1*COS(θt)+n2*COS(θ));
r:=(n1*COS(θt)-n2*COS(θ))/
(n1*COS(θt)+n2*COS(θ));
PRINT("t: "+t);
PRINT("r: "+r);
END;

END;

TI-84 Plus CE Program

"EWS 2017-12-17"
{1,1.0045,2.15,2.42,1.52,1.31,2.65,1.47,1.54,1.76,3.45,1.33}→L6
Degree
For(K,1,2)
Disp "1. AIR 2. CO2 3. CUB.ZIC.","4. DIAMOND 5. GLASS 6. ICE","7. MOISANITE","8. PYREX 9. NACL","10. SAPPHIRE 11. SIL.","12. WATER"
Input M
If K=1:M→N
End
L6(N)→N:L6(M)→M
Input "INCIDENT: °",θ
sin^-1(N*sin(θ)/M)→A
Disp "TRANSMITED: °",A
If M>N:Then
sin^-1(N/M)→C
Disp "CRITICAL: °",C
End
Pause
Menu("POLARISE?","PERPENDICULAR",1,"PARALLEL",2,"NONE",3)
Lbl 1
(2Ncos(θ))/(Ncos(θ)+Mcos(A))→T
(Ncos(θ)-Mcos(T))/(Ncos(θ)+Mcos(T))→R
Disp "T",T,"R",R
Goto 3
Lbl 2
(2Ncos(θ))/(Ncos(T)+Mcos(θ))→T
(Ncos(T)-Mcos(θ))/(Ncos(T)+Mcos(θ))→R
Disp "T",T,"R",R
Lbl 3



Source:
Klaus Jäger, Olindo Isabella, Arno H.M. Smets, René A.C.M.M. van Swaaij, Miro Zeeman  Solar Energy: Fundamental, Technology, and Systems  Delft University of Technology, 2014
(no money is made from this blog entry)

Hopefully you find this useful.

Eddie


This blog is property of Edward Shore, 2017

Basic vs. Python: Numeric Guessing Games (Featuring Casio fx-702P and fx-CG100)

Basic vs. Python: Numeric Guessing Games Calculators Used Basic: Casio fx-702P Python: Casio fx-CG100 Task Generate two simpl...