Engineering
Lensmaker's equation API
Computes focal length and dioptric power of a thin lens from its refractive index and two surface radii via 1/f = (n/n_med − 1)(1/R1 − 1/R2), with optional surrounding-medium index. Answers 'What focal length results from these radii?', 'How many dioptres is this lens?'.
Price$0.04per request
MethodPOST
Route/v1/engineering/lensmaker
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
opticslensmakerlensdioptrefocal-lengthrefractive-indexcurvaturephysics
API URL
Integration docshttps://x402.hexl.dev/v1/engineering/lensmakerExample request
{
"refractiveIndex": 1.5,
"radius1M": 0.2,
"radius2M": -0.2
}Example response
{
"focalLengthM": 0.2,
"powerDioptres": 5,
"relativeIndex": 1.5,
"lensType": "converging",
"interpretation": "Converging lens, f = 0.2 m, power = 5 D."
}Input schema
{
"type": "object",
"required": [
"refractiveIndex",
"radius1M",
"radius2M"
],
"properties": {
"refractiveIndex": {
"type": "number",
"description": "Lens material refractive index",
"examples": [
1.5
]
},
"radius1M": {
"type": "number",
"description": "First surface radius of curvature (m)",
"examples": [
0.2
]
},
"radius2M": {
"type": "number",
"description": "Second surface radius of curvature (m)",
"examples": [
-0.2
]
},
"mediumIndex": {
"type": "number",
"description": "Surrounding medium index (default 1)",
"examples": [
1
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}