# Lenses
[[Functional Programming]]
Lenses are the FP equivalent of the accessor pattern in OOP.
A lens combines a getter and a setter, and allows the programmer to focus on a specific part of a bigger structure.
Lenses are a bigger part of [[Optics (FP)]]
See [[BOOK - Optics by Example]]
## Flange distance
![[Pasted image 20241020104719.png]]
> [!ai]+ Claude
>
> Flange focal distance (also called register or flange distance) refers to the distance between the lens mount and the image sensor or film plane in a camera system. Here are the key points about flange distance:
>
> ## What is Flange Focal Distance?
>
> - It is the distance from the lens mounting flange to the film/sensor plane in a camera[1][2]
> - Also known as flange distance, flange depth, register, or back focus[2]
> - Measured in millimeters and specified for each lens mount system[2]
>
> ## Why It Matters
>
> - Determines whether a lens can be adapted to a different camera mount[1][3]
> - Affects the ability to achieve infinity focus with adapted lenses[1][3]
> - Influences the thickness required for lens mount adapters[1]
>
> ## Typical Flange Distances
>
> - DSLR cameras: Around 40-45mm (to accommodate mirror box)[3][4]
> - Canon EF mount: 44mm
> - Nikon F mount: 46.5mm
> - Mirrorless cameras: Much shorter, around 15-20mm[3][4]
> - Sony E-mount: 18mm
> - Micro Four Thirds: 19.25mm
>
> ## Adapting Lenses
>
> - Lenses can be adapted to camera bodies with shorter flange distances[1][3]
> - Adapter thickness = Lens flange distance - Camera flange distance[1]
> - Adapting to longer flange distances requires corrective optics[3]
>
> ## Importance in Camera Design
>
> - Crucial for achieving proper focus across the focusing range[2]
> - Precision is critical - errors of 0.01mm can affect focus accuracy[2]
> - Mirrorless cameras can have shorter flange distances, enabling more compact designs[4]
>
> Understanding flange focal distance is key for photographers interested in using adapted lenses or exploring vintage glass on modern camera bodies. It explains why certain lens adaptations are possible while others are not.
>
> Citations:
> [1] https://briansmith.com/flange-focal-distance-guide/
> [2] https://en.wikipedia.org/wiki/Flange_focal_distance
> [3] https://expertphotography.com/flange-distance
> [4] https://www.fredmiranda.com/forum/topic/1542593/
> [5] https://alphatracks.com/flange_focal_distance/
> [6] https://lenshunters.com/guides/using-vintage-lenses/flange-focal-distance
>
> https://www.perplexity.ai/search/what-s-the-register-flange-dis-L9UW0f3NSiuKUzPYhRSs5w
## Mounts
- [Lens-mount-identification | Robert Allen Kautz Photography](https://www.robertallenkautzphoto.com/lens-mount-identification)
- [SLR Lens Mount Identification Guide](https://web.archive.org/web/20240416015052/https://members.tripod.com/rick_oleson/index-99.html)
- [Camera Mounts Sorted by Register](https://www.graphics.cornell.edu/~westin/misc/mounts-by-register.htmli)
### [[Pentax]] K-Mount
- [Pentax K-mount - Wikipedia](https://en.wikipedia.org/wiki/Pentax_K-mount)
- [Comprehensive Pentax Lens Guide - Gear Guides | PentaxForums.com](https://www.pentaxforums.com/articles/gear-guides/comprehensive-pentax-lens-guide.html)
-
![[Pasted image 20241020104314.png]]
## Links
FP Complete overview of Lenses, goes into Van Laarhoven lenses into a bit more detail (but does it explain what this is about? I don't know)
- [Lenses](https://www.fpcomplete.com/haskell/tutorial/lens/), discussion on HN: [Lenses | Hacker News](https://news.ycombinator.com/item?id=31890781)
The discussion on [[Hacker News]] brought up this video, which seems pretty cool:
- [John Wiegley: Putting Lenses to Work - YouTube](https://www.youtube.com/watch?v=QZy4Yml3LTY)
And this one:
- [09 The Unreasonable Effectiveness of Lenses for Business Applications - YouTube](https://www.youtube.com/watch?v=T88TDS7L5DY&t=1204s)
[[2022-07-04]]
A series of exercises by [[William Yaoh]] to learn lenses:
- [Exercises for understanding lenses | William Yao](https://www.williamyaoh.com/posts/2019-04-25-lens-exercises.html)