Engineering
Thin lens / mirror equation API
Solves the thin-lens/spherical-mirror equation 1/f = 1/do + 1/di for whichever of focal length, object or image distance is missing, plus magnification and real/virtual + upright/inverted classification with sign conventions handled. Answers 'Where does a lens form the image?', 'Is the image real, inverted, and magnified?'.
Price$0.04per request
MethodPOST
Route/v1/engineering/thin-lens
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
opticslensmirrorthin-lensfocal-lengthmagnificationimagingphysics
API URL
Integration docshttps://x402.hexl.dev/v1/engineering/thin-lensExample request
{
"focalLengthM": 0.1,
"objectDistanceM": 0.3
}Example response
{
"focalLengthM": 0.1,
"objectDistanceM": 0.3,
"imageDistanceM": 0.15,
"magnification": -0.5,
"imageType": "real",
"orientation": "inverted",
"relativeSize": "reduced",
"interpretation": "Image is real, inverted, reduced (|m| = 0.5)."
}Input schema
{
"type": "object",
"properties": {
"focalLengthM": {
"type": "number",
"description": "Focal length in metres (>0 converging, <0 diverging)",
"examples": [
0.1
]
},
"objectDistanceM": {
"type": "number",
"description": "Object distance in metres",
"examples": [
0.3
]
},
"imageDistanceM": {
"type": "number",
"description": "Image distance in metres",
"examples": [
0.15
]
}
},
"description": "Provide exactly two of the three distances."
}Output schema
{
"type": "object",
"additionalProperties": true
}