Calculations with context
CPA and TCPA calculator
Calculate CPA, TCPA and minimum separation within a selected time horizon using a constant-velocity relative-motion model.
Explore how relative motion, time direction and a prediction window change the minimum separation between two reference points.
Common starting instant t₀: both positions and ground-velocity vectors must refer to the same instant and the same east/north frame. Positive east is right; positive north is up. The own-ship reference point remains at (0, 0) in this relative frame.
Worked example loaded
Read the three different minima
Future-only closest approach
2 NM
at 30 min
From t₀ onward, with no upper time limit
Minimum inside the window
3.887 NM
at 5 min / 5 min
From t₀ to the entered horizon
Whole-line geometry
30 min
Signed TCPA · Whole-line DCPA: 2 NM
The mathematical time line includes the past.
Current separation
4.472 NM
Closing at t₀
Relative speed: 8 kn
The minimum is at the horizon boundary. This window can end before the whole-line closest approach.
Displayed numbers are rounded; extra digits in the CSV are computational precision, not sensor accuracy.
Relative-motion diagram
- Own ship
- Target at t₀
- Future closest
- Horizon
This is a point-motion diagram, not a nautical chart. Both axes use the same scale in NM. Marker sizes do not represent hulls.
Solid path: entered window. Dashed extension, if shown: future closest point outside that window.
| Reference point / event | Time from t₀ (min) | East (NM) | North (NM) | Separation (NM) |
|---|---|---|---|---|
| Own ship | 0 | 0 | 0 | — |
| Target at t₀ | 0 | 4 | 2 | 4.472 |
| Future closest | 30 | 0 | 2 | 2 |
| Horizon | 5 | 3.333 | 2 | 3.887 |
Calculations stay in this page. CSV export happens only when you click Download; no calculation data is sent to an external service.
How the calculation works
Use nautical miles for position and knots for velocity; time in the vector equation is in hours. DCPA is a distance. TCPA is a signed time, so a negative value is not a future countdown.
- r(t) = r₀ + vᵣ t
- vᵣ = vtarget − vown
- tline = −(r₀ · vᵣ) / (vᵣ · vᵣ), when relative speed is nonzero
- DCPAline = |r₀ + vᵣ tline|
- tfuture = max(0, tline)
- twindow = max(0, min(H, tline))
For COG θ and SOG s: east velocity = s sin θ; north velocity = s cos θ. Angles are converted from degrees before evaluating sine and cosine. Results convert hours to minutes.
At exactly zero relative velocity, separation is constant and every time is a minimizing time. The calculator reports no unique TCPA rather than dividing by zero. Very small nonzero relative speeds can produce a distant, highly sensitive TCPA.
Reproduce the worked example
These are invented teaching inputs, not an observed encounter: r₀ = (4, 2) NM and vᵣ = (−8, 0) kn.
- Current separation: √(4² + 2²) = 4.472 NM.
- Signed TCPA: −[4 × (−8) + 2 × 0] / 64 = 0.5 h = 30 min.
- At 30 min: relative position (0, 2) NM; whole-line and future DCPA = 2.000 NM.
- Within only the next 5 min: position at the minimum is (3.333, 2) NM; minimum separation = 3.887 NM at the window boundary.
Assumptions and interpretation
- Both vessels retain constant COG and SOG. Maneuvers, acceleration, current changes and delayed responses are excluded.
- The east/north model is planar and local. It is not a geodesic calculation; large distances and long extrapolations weaken its physical relevance.
- Positions and velocities are synchronized at t₀. This tool does not align sensor timestamps or retrieve AIS, radar or live position data.
- Distances are between reference points. Hull shape, beam, tow, shoreline, depth and clearance are not represented.
- Measurement error and uncertainty are not modeled. Neither a small nor a large DCPA alone gives a collision probability or a universal passing-distance verdict.
Read the context
The equations and numerical example follow the site’s relative-motion guide. The primary sources explain the wider observation and navigation-rule context.
- CPA/TCPA meaning and limits
- Heading, water-relative and ground-relative motion
- USCG: navigation-rules FAQs
- IMO: preventing collisions at sea
The USCG states that the navigation rules do not prescribe one distinct safe passing distance. IMO’s COLREG overview describes lookout and risk-assessment duties. This teaching tool does not apply encounter rules or decide operational action.
The calculation interface could not load. The example and explanation below remain readable; reload the page to recalculate.
Read the method and its limits
- CPA and TCPA: what do they predict, and what do they leave out?
- Heading and motion through water and over ground
- Evaluating collision-avoidance simulations: scenarios, metrics and validation
Related project: Colav Lab
All calculators