Helper rays
A helper ray is a dashed construction line. It never forms images. Choose it from the corner of the Ray tool, or press H (R goes back to ordinary rays).
To trace any ray through a lens: draw a helper from the lens centre, parallel to that ray. The ray leaves the lens through the point where the helper crosses the back focal plane (snap through that ray at the back focal plane). Repeat at each lens. Turn on Show focal planes in the lenses' panels.
Why this works: the helper starts at the lens, but the ray it copies is behind the lens. RayMan offers parallel to that ray for any ray on the bench, wherever it is: swing the helper until the ray behind it glows, then click. A ray drawn parallel to a helper wins over other snaps nearby, and every ray parallel to it glows.
Example: a source just inside F of an objective, then a tube lens.
Select a ray and press N to name it (r1 is drawn as r₁).
A negative lens
Its image is virtual: turn on Show virtual images in Settings. F′ is now on the left.
- Place a lens and give it a negative f in its panel.
- Place an object a little shorter than the lens, between F′ and 1.5F′.
- From the tip, a ray aimed at the centre of the lens (snap through the centre of L1): it carries straight on, undeviated.
- From the tip, a ray parallel to the axis to the lens.
- A helper (H) from F′ to the end of that ray.
- Back to rays (R): continue the ray parallel to that ray (the helper). The virtual image appears where the helper meets the first ray.
- From the tip, a ray through F on the far side: it stops at the lens. Continue it parallel to the axis. A helper from the lens to F shows where it was aimed.
Clicking a ray's end continues it only if it is the kind you are drawing: with R, a helper's end starts a new ordinary ray.
Light from infinity
A ray started at a free point comes from a point at infinity. Rays drawn parallel to the axis, or parallel to that ray, share that point. Where they cross after a lens, RayMan marks a focus. The rays carry on past it.
Leaving a lens, a ray can also snap bent by the lens: the way an ideal thin lens bends it, for rays no classic rule covers.
Carrying rays on through an image
Rays from one point that meet after a lens stop at the image they form. A click on the image starts a new ray from it. To carry the rays themselves on, as light goes on through a real image (the lamp's images in Köhler illumination): with the Ray tool, Shift-click the image. One ray ending there is cut at the image and drawn on from it; aim it straight on. One Shift-click per ray; the ray in the current ray colour goes first. Needs a keyboard.
Irises and fill-in rays
An iris stops rays that meet its blades. Drag the edges of its opening (no panel opens, so the rays stay in view), or click a blade for its panel and slider. Its centre and edges are points to aim through. It lines up with focal points and images: an aperture stop in a focal plane, a field stop in an image plane.
Fill-in (B) adds faint rays between the outermost rays of each bundle, interpolated from the rays you drew. Irises clip them too.
Tick Hide the rays it stops in the iris's panel: the fill-in rays it blocks vanish and the drawn ones become faint ghosts (still selectable), leaving the light that gets through. The outermost fill-in rays that pass are drawn bold, to mark its edges.
The examples/kohler/ files (File → Open…) build Köhler illumination step by step.
Share and embed
In the menu (the page icon), Copy share link copies a link that opens the scene in RayMan. The scene is inside the link, so it is not stored anywhere. Copy embed code copies HTML that shows the scene, read-only, in any web page.
In the page, Open in RayMan opens the diagram in a new tab, and ⌘Z there brings back
what the reader had. Enlarge shows it over the page, where you can pan and zoom. A diagram can also be loaded from a
saved .json file:
<script src="https://swcmicroscopy.com/RayMan/embed.js" defer></script>
<div class="rayman" data-src="my-scene.json"></div>
Examples, and the options (height, dark theme, hiding the buttons).
Workbooks
A workbook is a web page of exercises. Click one to work on it in RayMan, over the page. Back to workbook returns, and the diagram in the page shows what you did. Your work is kept in the browser. Save downloads the page with your answers in it: open that file, or Load it into the page online, to carry on. Start again puts an exercise back as it was.
To write one, load workbook.js and give each exercise an id and its
starting scene as a .json file next to the page (data-src; save it from
RayMan's File menu). The instructions go in an element with class rayman-instructions;
they show above RayMan while the student works. Serve the page from a web address. See the
example workbook.
Install as an app
RayMan can sit on the home screen of an iPad, iPhone or Android device and open like an app, without the browser's bars. It still comes from the website, so it updates with it. After the first visit it also works offline.
iPad and iPhone (Safari)
- Open RayMan in Safari.
- Tap Share (the square with an arrow, by the address bar; on newer iPadOS it may be under ⋯).
- Choose Add to Home Screen, then Add.
The app keeps its own saved bench, separate from Safari's: use File → Save and Open to move work between them. To pick up a new icon, remove the app and add it again.
Android (Chrome)
- Open RayMan in Chrome.
- Tap ⋮, then Install app (or Add to Home screen).
Chrome may also offer to install it by itself. The app shares Chrome's saved bench.







