### 概要 `src/hooks/useSimulationMode.ts` のコメントは、`trainRoute` の `distanceFromPrevious` を線路長ベースの値として説明しています。 https://github.com/TrainLCD/MobileApp/blob/654ed4010bc0573dcb5eee019dab1ddf561e2f44/src/hooks/useSimulationMode.ts#L325-L327 現在の StationAPI では、この値は隣り合う駅の座標から計算した直線距離です。 - フィールドの定義には「直前駅からの距離 (メートル, Haversine)。先頭は 0。」とあります。 https://github.com/TrainLCD/StationAPI/blob/a11a92fb706641e5fc9cb19d4e4340930cebd131/stationapi/src/model.rs#L349-L350 - `train_route_segments` は、直前の駅と現在の駅の緯度経度を `haversine_distance` に渡して距離を求めています。 https://github.com/TrainLCD/StationAPI/blob/a11a92fb706641e5fc9cb19d4e4340930cebd131/stationapi/src/use_case/interactor/query.rs#L1273-L1276 このコメントを読んだ人は、値を線路長だと受け取ります。そのまま新しい処理を書くと、直線距離を線路長として扱ってしまいます。 ### 想定されている解決策 コメントを「サーバーから受け取った、隣り合う駅どうしの直線距離(Haversine)を積算する」という内容に直します。シミュレーションの動作は変えません。 ### その他 このコメントは #6341 で追加されました。
Activity