<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLCamera/barrelDistortion",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLCamera(py)barrelDistortion"
  },
  "title" : "barrelDistortion"
}
-->

# barrelDistortion

The first coefficient for determining the radial distortion applied to pixels rendered using the camera.

```
var barrelDistortion: Float { get set }
```

## Discussion

Light passing through any lens produces some amount of radial distortion, which a renderer can compute based on the [`focalLength`](/documentation/ModelIO/MDLCamera/focalLength) property. However, some lenses or aesthetic designs introduce additional distortion. A renderer can model radial distortion using the following equation, in which `r` is the radial distance from a pixel to be rendered to the center of the projection, and `r’` is the new radial distance to that pixel accounting for distortion:

`r' = r * (1 +` [`barrelDistortion`](/documentation/ModelIO/MDLCamera/barrelDistortion) `* r^2 +` [`fisheyeDistortion`](/documentation/ModelIO/MDLCamera/fisheyeDistortion) `* r^4)`

A nonzero [`barrelDistortion`](/documentation/ModelIO/MDLCamera/barrelDistortion) value sufficiently describes the distortion characteristic of most lenses. To simulate other lenses—such as security cameras, plastic toy lenses, or VR headsets—use both the [`barrelDistortion`](/documentation/ModelIO/MDLCamera/barrelDistortion) and [`fisheyeDistortion`](/documentation/ModelIO/MDLCamera/fisheyeDistortion) properties. The default value of both radial distortion parameters is zero, resulting in a rectilinear projection.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)