Depth of Field Calculator
calculate_depth_of_fieldUse this when you need to know how much of a scene is acceptably sharp for given camera settings, or how far sharpness extends in front of and behind the focused subject. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this when you only need the focus distance that maximises depth of field (use hyperfocal-distance), or you shoot macro above about 0.2× magnification where lens extension and pupil magnification make the thin-lens equations inaccurate. What it computes: Computes the near and far limits of acceptable sharpness, the total depth of field and the hyperfocal distance from focal length, f-number, focus distance and the sensor's circle of confusion, using the standard thin-lens depth-of-field equations. Inputs: focal_length_mm (number, mm); aperture_f (number); focus_distance_m (number, m); sensor (enum, optional); coc_mm (number, mm, optional). Complete JSON argument examples: {"focal_length_mm":50,"aperture_f":2.8,"focus_distance_m":3,"sensor":"full_frame"} | {"focal_length_mm":24,"aperture_f":8,"focus_distance_m":5,"sensor":"full_frame"} Outputs: hyperfocal_m [m], near_limit_m [m], far_limit_m [m], far_limit_text, total_dof_m [m], in_front_of_subject_m [m], behind_subject_m [m], coc_used_mm [mm]. Formula: H = f² / (N·c) + f; near = s·(H − f) / (H + s − 2f); far = s·(H − f) / (H − s) when s < H, otherwise infinity (f = focal_length_mm, N = aperture_f, c = coc_mm, s = focus_distance_m × 1000, all in mm) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/depth-of-field with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/photography/depth-of-field.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coc_mm | No | Optional acceptable circle-of-confusion diameter; overrides the preset value (full frame 0.030, APS-C 0.020, Micro Four Thirds 0.015, 1-inch 0.011 mm). Unit: mm. | |
| sensor | No | Sensor format; selects the circle of confusion (0.030 mm full frame, 0.020 mm APS-C, 0.015 mm Micro Four Thirds ...). | full_frame |
| aperture_f | Yes | Lens f-number, e.g. 2.8 for f/2.8. | |
| focal_length_mm | Yes | Actual (not equivalent) focal length of the lens in millimetres. Unit: mm. | |
| focus_distance_m | Yes | Distance from the camera's sensor plane to the focused subject in metres. Unit: m. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| result | Yes | ||
| request | Yes | ||
| sources | No | ||
| success | Yes | ||
| version | No | ||
| freshness | No | ||
| timestamp | Yes | ||
| next_actions | No |