「空き時間グリッド」は Pro に含まれます。解除するとプレビューが表示されます。
「薄いレンズの結像」は Pro に含まれます。解除するとプレビューが表示されます。
仕組み
凸レンズの教科書風の光線図です。光軸とレンズは中間色で描き、両側に F と 2F を示します。物体はアクセント色の切り欠きのある小旗で、光軸に沿ってドラッグする、横を押す、キーを使う、五つの位置ボタンのどれかを押す、のいずれかで動かせます。旗の先端から三本の代表的な光線が出ます。平行光線は F′ を通るように曲がり、中心を通る光線はそのまま直進し、焦点を通る光線は F を通ったあと平行に進みます。交わった点が像で、同じ旗を倍率で拡大縮小して描きます。倒立なら上下逆さに、虚像なら破線で描き、光線を逆に延ばした線も破線で示します。読み取り欄には dₒ、dᵢ(虚像は負)、m = −dᵢ/dₒ と、物体がある範囲の結像を一文で示し、位置ボタンもその範囲を示します。像が図の外に出たときは、その方向の隅に小さな注記を出します。
向いている場面
- 凸レンズの結像の規則を教えるときに、物体を 2F と F の内外へ動かし、像の位置・大きさ・向きの変化を確かめてもらいます。
- カメラ、プロジェクター、虫めがねを同じレンズの三つの物体位置として説明し、読み取り欄のレンズの式で答えを確かめます。
向かない場面
- 厚いレンズ、レンズ系、収差には向きません。近軸光線による理想的な薄いレンズのモデルです。
使い方
import React, { useState } from 'react'
import { FocalFlagBench } from './FocalFlagBench.jsx'
export function LensLesson() {
const [distance, setDistance] = useState(100)
return (
<FocalFlagBench
distance={distance}
onDistanceChange={(next) => setDistance(next)}
focalLength={40}
labels={{ title: 'Where does the image form?' }}
/>
)
}プロパティ
| プロパティ | 型 | 既定値 | 説明 |
|---|---|---|---|
distance | number | — | 物体距離 dₒ(mm)を外部から指定します。1 mm 単位に丸め、0.2f〜3f に収めます。 |
defaultDistance | number | 60 | 内部状態の初期物体距離です。どちらの使い方でもリセットはこの値に戻ります。 |
onDistanceChange | (distance, details) => void | — | 新しい距離と { reason('press'、'drag'、'tap'、'key'、'place'、'cancel'、'reset')、region('beyond'、'at2f'、'between'、'atF'、'inside')、imageDistance(mm、虚像は負、F では null)、magnification(F では null)} を受け取ります。 |
focalLength | number | 40 | 焦点距離 f(mm、整数、5 以上)。図は f を単位に描くので、変わるのは数値だけです。 |
labels | object | — | 組み込みの文言を置き換えます:title、formula、focal('{f}')、rays(三つ)、marks(四つ)、objectDistance、imageDistance、magnification、distance、valueText('{d}'、'{image}')、help、offView、place、reset、regions.beyond / at2f / between / atF / inside(それぞれ tab、name、image、note)。 |
locale | string | 'en' | 数値の表示に使う言語タグです。 |
className | string | — | カードに追加するクラス名です。幅の指定などに使います(既定は 30rem、コンテナより広くなりません)。 |
アクセシビリティ
- The figure is a slider for the object distance. Left and Right arrows move the flag that way along the axis (Left is farther); Up and Down add or remove 1 mm, Page Up and Page Down 10 mm, Shift with an arrow 10 mm, Home and End go to the nearest and farthest place. Its value text reads the distance and the kind of image, and a description explains the keys.
- The five place buttons are toggle buttons named after their region; the one for the object's current region is pressed. The sentence about the region is a polite live region, so it is read when the region changes.
- Dragging uses pointer capture. A finger on the flag drags it at once; elsewhere on the figure a finger changes nothing until it moves sideways or lifts, so vertical scrolling is not caught. A cancelled gesture restores the distance it started from.
- Colour is not the only key: the legend names each ray, the image repeats the object's shape, and a virtual image is dashed as well as softer.
モーション
キー、位置ボタン、タップ、リセットの後は、旗・光線・像が --ds-duration-slow で新しい距離へなめらかに移るので、F を越えると像が無限遠へ飛んで戻ってくる様子が見えます。ドラッグ中はポインターにそのまま追従します。視差効果を減らす設定では、すべての変化がすぐに反映されます。
プロジェクトに追加
Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。
FocalFlagBench.jsxfocal-flag-bench.csstokens.cssREADME.md
2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。
同じカテゴリ
フォーム入力「図形のブール演算」は Pro に含まれます。解除するとプレビューが表示されます。
「カスケード選択」は Pro に含まれます。解除するとプレビューが表示されます。







