Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ An invalid calendar date is rejected rather than rolled into the next month.

## 🎯 Use cases

### Ways of using this tool in particular

- Finding a height from the length of a shadow (science and math classes): for the Marugame Castle sample image (10:33 on 24 July 2016), the sun is at 64.0° and the shadow length shows as "0.49× the height". Measure a shadow and divide by 0.49 to get the height; a 1.5 m shadow means about 3.1 m. Set the location and the analysis time to your schoolyard and the class time to get the ratio there. It is a real-world example of the tangent (only on flat ground with a clear shadow tip)
- Comparing sunlight across the seasons (house hunting and gardening): set the location by hand and change only the analysis time to compare the sun's altitude. At noon (UTC+09:00) at 35.68°N, 139.77°E (near Tokyo Station), 22 December 2026 (winter solstice) gives 30.7° with a shadow 1.69 times the height, and 21 June (summer solstice) gives 77.2° and 0.23 times. A 10 m building to the south casts a shadow of about 17 m at noon on the winter solstice (terrain and the shapes of nearby buildings are not taken into account)
- Finding a camera clock left on home time in travel photos (organizing photos): for photos with a GPS time, the tool infers the UTC offset from the difference between the capture time and the GPS time (UTC). If a photo taken in Bangkok has a capture time of 14:00:00 and a GPS time of 05:00:02 UTC, the inferred offset is UTC+09:00 (residual -2 seconds). Bangkok's standard time is UTC+07:00, so the camera clock was still on Japan time, which tells you how to fix the times in the album (smartphones set their clocks automatically, so this is less likely with them)

### OSINT and verification

- **Checking social posts**: whether the claimed time and place hold together
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ HEIC/HEIFなどをブラウザーが表示できない場合も、プレビュ

## 🎯 ユースケース

### このツールならではの使い方

- 影の長さから高さを求める(理科・算数の授業):丸亀城のサンプル画像(2016年7月24日10時33分)では、太陽高度が64.0°で、影の長さは「高さの0.49倍」と出る。影を測って0.49で割れば高さになり、影が1.5mなら高さは約3.1mである。位置と解析日時を授業の校庭と時刻に合わせれば、その場の倍率が出る。三角比(tan)を実物で確かめる例になる(地面が平らで、影の先端がはっきりしている場合に限る)
- 日当たりを季節で比べる(住まい探し・家庭菜園):位置を手動で指定し、解析日時だけを変えて太陽高度を比べる。北緯35.68度・東経139.77度(東京駅付近)の正午(UTC+09:00)では、2026年12月22日(冬至)が30.7°で影は高さの1.69倍、6月21日(夏至)が77.2°で0.23倍になる。南に高さ10mの建物があれば、冬至の正午の影は約17mまで伸びる(地形やまわりの建物の形は計算に入らない)
- 旅行先の写真で、カメラの時計のずれを見つける(写真の整理):GPSの時刻が入った写真では、撮影日時とGPSの時刻(UTC)の差からUTCオフセットを推定する。バンコクで撮った写真の撮影日時が14:00:00、GPSの時刻が05:00:02 UTCなら、推定はUTC+09:00(残差-2秒)になる。バンコクの標準時はUTC+07:00なので、カメラの時計が日本時間のままだったとわかり、アルバムの時刻を直す手がかりになる(時計が自動で合うスマートフォンでは、このずれは起きにくい)

### OSINT調査・情報検証
- **SNS投稿の真偽判定**: 投稿画像の撮影時刻・場所の整合性確認
- **フェイクニュース検出**: 画像の再利用・転載元の特定
Expand Down
21 changes: 21 additions & 0 deletions test/readme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,24 @@ test('K YAML構造・保護値・シリーズ表記・未実装機能の範囲',
const withoutFuture = readme.replace(/## 🧭 今後の候補[^]*?(?=\n## )/, '');
assert.doesNotMatch(withoutFuture, /バッチ処理|CSV|座標系変換|UTM|JGD2011|視野角|磁気偏角|季節判定|自動削除|一時ストレージ/);
});

test('ユースケースの「このツールならではの使い方」の数値は計算部と同じ(日英)', () => {
const en = fs.readFileSync(path.join(root, 'README.en.md'), 'utf8');
const { SunCalc } = S;
assert.deepEqual([sun.altitudeDeg.toFixed(1), sun.shadowRatio.toFixed(2)], ['64.0', '0.49']);
assert.equal((1.5 / sun.shadowRatio).toFixed(1), '3.1');
assert.ok(readme.includes('太陽高度が64.0°で、影の長さは「' + ja('sun.shadowRatio', { ratio: '0.49' }) + '」'));
assert.ok(en.includes('the sun is at 64.0° and the shadow length shows as "0.49× the height"'));
const noon = (month, day) => L.sunReport(SunCalc, 35.68, 139.77,
L.wallToUtcMs({ year: 2026, month, day, hour: 12, minute: 0, second: 0 }, 540));
const [w, s] = [noon(12, 22), noon(6, 21)];
const got = [w.altitudeDeg.toFixed(1), w.shadowRatio.toFixed(2), s.altitudeDeg.toFixed(1), s.shadowRatio.toFixed(2)];
assert.deepEqual(got, ['30.7', '1.69', '77.2', '0.23']);
assert.equal(Math.round(10 * w.shadowRatio), 17);
assert.ok(readme.includes('冬至)が30.7°で影は高さの1.69倍、6月21日(夏至)が77.2°で0.23倍'));
assert.ok(en.includes('gives 30.7° with a shadow 1.69 times the height') && en.includes('gives 77.2° and 0.23 times'));
const wallBkk = { year: 2026, month: 8, day: 10, hour: 14, minute: 0, second: 0 };
const d = L.decideOffset({ wall: wallBkk, gpsUtcMs: Date.UTC(2026, 7, 10, 5, 0, 2) });
assert.deepEqual([d.source, L.formatOffset(d.offsetMin), d.residualSec], ['gps', '+09:00', -2]);
assert.ok(readme.includes('推定はUTC+09:00(残差-2秒)') && en.includes('UTC+09:00 (residual -2 seconds)'));
});
Loading