Sub topic 1
Rays, Wavefronts, and Measuring Angles from the Normal
This chapter sets up the geometry that the rest of the tutorial uses. You will learn what a ray is, how rays relate to wavefronts, and how to measure the angles of incidence, reflection, and refraction. Most errors in optics problems come from measuring an angle from the wrong reference line, so this chapter spends time on that.
Prerequisites
This chapter assumes you can do the following:
- Use sine and inverse sine on a calculator or in code, and know the difference between degrees and radians.
- Measure and read angles, including the angle between two lines that meet at a point.
- Use speed as distance divided by time.
- Accept that light can be described as a wave or as a ray that travels in a straight line through a uniform material.
You do not need any wave mathematics beyond that. Later chapters add the refractive index and Snell's law on top of the geometry here.
Two ways to picture light
Light is an electromagnetic wave. For many everyday problems, such as mirrors, lenses, and prisms, you can ignore the wave detail and treat light as a set of rays. Both pictures describe the same physical light. You choose the one that makes the problem easier.
- A ray is a straight line that shows the direction in which light energy travels. It has a direction but no width.
- A wavefront is a surface that connects all the points of a wave that are at the same phase. Phase is the position within the wave's cycle, for example a crest. A wavefront is like the line of a crest moving across water.
A ray is a model. A real beam of light has some width, and a laser pointer's beam is a bundle of many rays that travel almost in parallel. A single ray is a convenient way to follow one path through a system.
How rays and wavefronts fit together
In a uniform material, a ray is perpendicular to the wavefronts, and it points in the direction the wavefronts move. If you know the wavefronts, you can draw the rays. If you know the rays, you can draw the wavefronts.
The shape of the wavefronts tells you how the rays are arranged:
| Source or situation | Wavefront shape | Ray pattern |
|---|---|---|
| A small lamp far from you | Nearly flat planes | Nearly parallel rays |
| A small lamp up close | Spheres around the lamp | Rays spread out from the lamp |
| Light focused by a lens | Spheres that shrink toward a point | Rays converge on a point |
| An ideal laser beam | Flat planes over a small width | Parallel rays |
Sunlight is a good example of the first row. The Sun is so far away that the wavefronts reaching Earth are almost flat, so we draw the sunlight as parallel rays.
Why wavefronts matter for bending
You will mostly draw rays in this tutorial, but the wavefront picture explains why light bends at a boundary. Suppose a flat wavefront reaches a boundary at an angle. One end of the wavefront enters the new material first. If light moves more slowly in the new material, that end slows down while the other end is still moving fast. The wavefront turns, and since the ray is always perpendicular to the wavefront, the ray turns with it.
The refraction chapter develops this idea fully. For now, remember the rule: the ray is perpendicular to the wavefront, so any turning of the wavefront is a turning of the ray.
The interface and the normal
Reflection and refraction happen at an interface, which is the boundary between two materials, such as air and water. To describe a ray at an interface, you need three lines:
- The incident ray is the ray that arrives at the interface.
- The surface, which is the line (in 2D) or plane (in 3D) of the interface itself.
- The normal, which is the line perpendicular to the surface at the point where the ray hits.
The point where the incident ray meets the surface is the point of incidence. The normal is drawn through that point. It is usually shown as a dashed line, because it is a construction line and not a physical object.
Two more rays can leave the point of incidence:
- The reflected ray goes back into the first material.
- The refracted ray (also called the transmitted ray) continues into the second material, usually at a changed direction.
Measuring angles from the normal
Every angle in this tutorial is measured from the normal, not from the surface. This is the convention in optics, and it is the most common place to make a mistake.
- The angle of incidence, written θ₁ (or θᵢ), is the angle between the incident ray and the normal.
- The angle of reflection, written θᵣ, is the angle between the reflected ray and the normal.
- The angle of refraction, written θ₂ (or θₜ), is the angle between the refracted ray and the normal.
A ray that travels along the normal has an angle of 0°. This is called normal incidence. At normal incidence, the reflected ray goes straight back and the refracted ray goes straight on without bending. A ray that travels almost along the surface has an angle close to 90°. This is called grazing incidence.
So the valid range for an angle of incidence is 0° to 90°. The angle can never be larger than 90°, because a ray at 90° would travel along the surface and never reach the other side.
The surface angle trap
Many students and many textbooks for younger learners measure the angle from the mirror surface. That angle is called the glancing angle. The glancing angle and the angle from the normal add up to 90°.
def glancing_to_incidence(glancing_deg):
"""Convert an angle measured from the surface into an angle from the normal."""
if not 0 <= glancing_deg <= 90:
raise ValueError("Glancing angle must be between 0 and 90 degrees")
return 90 - glancing_deg
# A ray that skims the surface at 20 degrees from the surface
print(glancing_to_incidence(20)) # 70 degrees from the normal
# A ray that hits the surface straight on
print(glancing_to_incidence(90)) # 0 degrees from the normalThe output is 70 and then 0. The second call shows that a ray hitting the surface head-on has a glancing angle of 90° but an angle of incidence of 0°.
The plane of incidence
The incident ray and the normal together define a flat plane. This is the plane of incidence. In the standard rules of reflection and refraction, the reflected ray and the refracted ray both lie in this same plane. The consequence is that a diagram of one ray bouncing off one flat surface can be drawn on a flat sheet of paper, which is why 2D diagrams work.
When the incident ray, the normal, and the surface are all in one drawing, you only need to track a single angle for each ray. In 3D code, you use vectors, which the next chapter introduces for reflection.
Which side is which
Each ray lies on one side of the normal. In a standard diagram:
- The incident ray and the reflected ray are on opposite sides of the normal, both in the first material.
- The refracted ray is on the far side of the interface, in the second material, and it is on the opposite side of the normal from the incident ray.
Keeping this in mind lets you check a drawing quickly. If the refracted ray ends up on the same side of the normal as the incident ray, the diagram has an error.
Measuring angles in practice
A worked example shows the steps. A ray hits a flat mirror. You measure that the incident ray makes a 35° angle with the mirror surface.
- Draw the surface and the point of incidence.
- Draw the normal, perpendicular to the surface, through the point of incidence.
- Convert: the angle from the normal is 90° − 35° = 55°.
- Record θ₁ = 55°.
If a protractor reads 35° against the mirror, the angle you carry into any later calculation is 55°. In the next chapter you will see that the reflected ray also makes 55° with the normal, which means 35° with the surface.
Checking angles with code
Angles often come from a direction vector, such as (x, y), in simulations and graphics code. To get the angle from the normal, compare the direction with the normal vector using the dot product. The dot product of two unit vectors is the cosine of the angle between them.
import math
def angle_from_normal(direction, normal):
"""Angle in degrees between a ray direction and the surface normal.
Both arguments are 2D tuples. The function normalizes them first.
The ray is taken as travelling toward the surface, so we compare
the reversed direction with the normal that points back into the
first material.
"""
dx, dy = direction
nx, ny = normal
d_len = math.hypot(dx, dy)
n_len = math.hypot(nx, ny)
if d_len == 0 or n_len == 0:
raise ValueError("Vectors must have non-zero length")
cos_theta = (-dx * nx - dy * ny) / (d_len * n_len)
cos_theta = max(-1.0, min(1.0, cos_theta)) # guard against rounding
return math.degrees(math.acos(cos_theta))
# A horizontal mirror has its normal pointing up: (0, 1).
# A ray heading right and down at 45 degrees:
print(angle_from_normal((1, -1), (0, 1))) # about 45.0
# A ray heading straight down:
print(angle_from_normal((0, -1), (0, 1))) # 0.0, normal incidenceThe reversed direction is used because the normal points back into the first material while the incident ray points toward the surface. Without the sign flip, you would get 135° where you expect 45°.
Edge cases and common errors
- Measuring from the surface. Covered above. Always convert to the angle from the normal.
- Mixing degrees and radians. Python's
math.sinandmath.cosexpect radians. Convert withmath.radiansbefore the call, and withmath.degreesafter. - Curved surfaces. On a curved surface, the normal changes from point to point. Draw the normal at the point of incidence, perpendicular to the tangent line there. The rules stay the same, but the normal is no longer the same everywhere.
- Angles above 90°. If your calculation gives an angle of incidence above 90°, the ray is hitting the surface from the other side. Check the direction of your normal.
- Rays are a model. Ray diagrams break down when light passes through openings or around objects that are about as small as the wavelength of the light. In that case you see diffraction, which this tutorial does not cover. For mirrors, glass blocks, prisms, and lenses of ordinary size, the ray model works well.
Summary of the conventions
| Quantity | Symbol | Measured between | Range |
|---|---|---|---|
| Angle of incidence | θ₁ or θᵢ | Incident ray and normal | 0° to 90° |
| Angle of reflection | θᵣ | Reflected ray and normal | 0° to 90° |
| Angle of refraction | θ₂ or θₜ | Refracted ray and normal | 0° to 90° |
| Glancing angle | none | Ray and surface | 0° to 90° |
Exercise
A ray strikes a flat mirror and makes a 25° angle with the mirror surface. What are the angle of incidence and the angle of reflection, both measured from the normal? Then say what angle the reflected ray makes with the surface.
Show answer
The angle of incidence is 90° − 25° = 65°. By the law of reflection, which the next chapter develops, the angle of reflection equals the angle of incidence, so it is also 65°. The reflected ray makes 90° − 65° = 25° with the surface.
Exercise
A student reads a ray direction of (3, −3) heading toward a horizontal surface whose upward normal is (0, 1). Using the method in this chapter, what is the angle of incidence? What would a student get if they forgot to reverse the direction?
Show answer
The reversed direction is (−3, 3). The cosine of the angle is (−3·0 + 3·1) / (√18 · 1) = 3 / 4.243 ≈ 0.707, so the angle of incidence is 45°. If the direction is not reversed, the cosine is −0.707 and the result is 135°, which is not a valid angle of incidence.
Exercise
Why is the ray at any point of a spherical wavefront perpendicular to the wavefront, and what does this tell you about the rays from a small lamp?
Show answer
A spherical wavefront expands outward from the lamp, and the direction of travel at each point is along the radius, which is perpendicular to the sphere's surface there. So the rays from a small lamp point radially outward and spread apart. Far from the lamp, a small patch of the sphere looks flat, so the rays in that patch are nearly parallel.