# How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)?

What I'm trying to do is to simulate refraction through biconcave lens described by spheres A, B, C where C is a sphere in between A and B. So far I've gathered that a good approach would be to use CSG when it comes to modeling such object. I'm failing to understand how to implement this though. There are mentions of using Interval Arithmetics but I don't understand how exactly are they supposed to help me.

• Could you tell also where you found the "mentions of using Interval Arithmetics"? – rych Apr 29 '16 at 12:11
• @rych In this paper. – niksbenik Apr 29 '16 at 16:55