ForHosting KIT · Developer Utilities

Incidence angle from Snell's law calculator

This incidence angle calculator rearranges Snell's law to find the incoming ray direction needed to produce a specified refraction angle at a flat boundary.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the refractive index of the incident medium, the refractive index of the transmitted medium, and the desired refracted angle in degrees from the normal. The calculator returns the required incidence angle, intermediate sine values, and the relative index. It also identifies targets that no real incidence angle can produce, rather than returning an undefined or misleading result.

Rearranging Snell's law for the incidence angle

Snell's law is usually written as n1 times sine theta1 equals n2 times sine theta2. Here, n1 is the refractive index of the medium containing the incoming ray, theta1 is the incidence angle, n2 is the index of the medium the ray enters, and theta2 is the refraction angle. This calculator treats theta2 as the requested value and solves the equation in reverse. Dividing by n1 gives sine theta1 equals n2 divided by n1 times sine theta2. Taking the inverse sine then gives the required incidence angle: theta1 equals arcsine of that product. Every angle is measured in degrees from the surface normal. A ray aimed directly along the normal therefore has an angle of zero degrees, while a ray approaching parallel to the boundary tends toward ninety degrees. That convention matters because measuring from the surface would produce complementary values and an incorrect physical setup. The calculation assumes two homogeneous, isotropic media separated by one flat interface. It does not account for curved surfaces, graded-index material, wavelength-dependent dispersion, multilayer interference, or polarization effects. Within that scope, the result is deterministic and uses the same pure function in the browser and API.

Checking whether the requested refraction is physically reachable

An inverse calculation needs a domain check that can be easy to miss. The sine of a real angle cannot be greater than one, so the quantity n2 divided by n1 times sine theta2 must stay at or below one. If it exceeds one, no incidence angle between zero and ninety degrees can create the requested refracted ray for those two indices. This situation often appears when the transmitted medium has a larger refractive index than the incident medium and the requested refraction angle is too large. The calculator rejects that request with an invalid-input message and reports the maximum reachable refraction angle for context. At the exact boundary, the required incident ray is grazing at ninety degrees. Small floating-point noise near that boundary is safely clamped, while genuinely impossible values are never silently altered. Both refractive indices must be finite and strictly positive, because refractive index zero or a nonnumeric value does not define this form of Snell's law. The target refraction angle must be from zero through ninety degrees, inclusive. Use absolute refractive indices for ordinary optical work, such as approximately one for air, 1.333 for water, or about 1.5 for common glass.

Using the result in experiments, designs, and software

The returned angle_incidence value is the direction to set relative to the interface normal. In a classroom experiment, rotate the incoming laser or the sample until the incident ray has that angle, then compare the measured transmitted ray with the requested angle_refraction. In optical layout work, use the result as a first-order boundary calculation before moving to a full ray tracer that includes thickness, curvature, and multiple surfaces. Software can also use this capability to position an interactive ray, validate a proposed geometry, or generate answer keys from a list of materials and target angles. The response echoes the cleaned indices and target angle, provides both sine values for auditing, and returns n2 divided by n1 as relative_index. Those intermediate fields make it easier to verify unit conversions and catch a swapped medium order. The formula and unit fields are suitable for display, but the numeric fields should remain the source for downstream computation. A successful API request uses the published base price of $0.002 per item, while the browser calculator runs locally. Because the algorithm performs constant-time arithmetic without network access, repeated calls with identical inputs return identical values and are appropriate for automated tests.

Set up a refraction experiment

Find the laser incidence angle needed to observe a chosen transmitted angle at an air, water, acrylic, or glass boundary.

Validate an optical layout

Check whether a target ray direction is reachable at a single interface before building a more detailed ray-tracing model.

Generate optics exercises

Create deterministic incidence-angle answers and reject physically impossible index-and-angle combinations in worksheets or auto-graders.

What formula finds the incidence angle?

The calculator rearranges n1·sin(theta1) = n2·sin(theta2) to theta1 = arcsin((n2/n1)·sin(theta2)).

Are the angles measured from the surface?

No. Both incidence and refraction angles are measured from the surface normal. Zero degrees is normal incidence and ninety degrees is grazing incidence.

Why can a requested refraction angle be unreachable?

A real incidence angle requires (n2/n1)·sin(theta2) to be no greater than one. A larger value has no real inverse-sine result for this interface.

What refractive index values should I enter?

Enter finite positive absolute indices for the incident and transmitted media. Typical approximate values are 1 for air, 1.333 for water, and 1.5 for common glass.

What does the calculator cost?

The browser calculator runs locally for free. Each successful API item uses the published base price of $0.002.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/optics/incidence-angle-from-snell

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/optics/incidence-angle-from-snell \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n1":1,"n2":1.5,"angle_refraction":19.4712206345}'
{
  "n1": 1,
  "n2": 1.5,
  "angle_refraction": 19.4712206345
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "optics.incidence_angle_from_snell",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →