# Geometric ray tracing

**URL:** <https://discourse.julialang.org/t/geometric-ray-tracing/17182>\
**Category:** Modelling & Simulations\
**Tags:** question, proposal\
**Created:** [November 5, 2018, 7:45pm UTC](https://discourse.julialang.org/t/geometric-ray-tracing/17182 "2018-11-05T19:45:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 5, 2018, 7:45pm UTC](https://discourse.julialang.org/t/geometric-ray-tracing/17182/1 "2018-11-05T19:45:54Z")

</div>

Is there anyone out there that is both semi-versed in geometric ray tracing and wants to write a good ray tracing library?

To be clear, I’m not talking about [ray tracing in graphics](https://en.wikipedia.org/wiki/Ray_tracing_(graphics)) but more about [ray tracing in physics](https://en.wikipedia.org/wiki/Ray_tracing_(physics)), and geometric at that (at least to start with). While these two fields overlap a lot (especially lately with all the “real ray tracing” interest in the graphics world) the main differences are the goals (modeling accurate trajectories and phenomenon versus rendering a realistically looking image).

There are a few efforts out there that already fulfill parts of what a ray tracing package should be able to do. The most prominent one is [DynamicalBilliards.jl](https://github.com/JuliaDynamics/DynamicalBilliards.jl). But none are a ray tracer. I’m therefore considering investing some time in adding some ray-tracing-functionalities to `DynamicalBilliards.jl` (see #dynamics-bridged on slack for more background).

`DynamicalBilliards.jl`’s main author, @Datseris, is super stocked and enthusiastic about all of this, which makes this whole endeavor even more fun. What would be even better though, is if anyone here is into geometric/wave optics and wants to build an awesome ray tracing library…

The main idea for now is to just add functionalities to `DynamicalBilliards.jl` since it’s so well suited for this, and if down the road we need to split to our own library then we’ll deal with that then.

Thoughts, comments, suggestions?

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [November 5, 2018, 9:57pm UTC](https://discourse.julialang.org/t/geometric-ray-tracing/17182/2 "2018-11-05T21:57:18Z")

</div>

That would be nice !  
I wrote that kind of ray tracer in python ([geoptics](https://github.com/ederag/geoptics)),  
with an emphasis on interactivity, and was contemplating moving to julia.

[DynamicalBilliards.jl](https://github.com/JuliaDynamics/DynamicalBilliards.jl) could be a great for that, good idea !

> [@yakir12](#):
>
> What would be even better though, is if anyone here is into geometric/wave optics and wants to build an awesome ray tracing library

Being a julia newbie, I could only help with the physical stuff and transfer the little know-how gained in geoptics. A good starting point could be its [`propagate`](https://github.com/ederag/geoptics/blob/4acca96ffaba93aff634183a47b3171b480d3c75/geoptics/elements/rays.py#L211) method.  
Please let me know if the algorithm needs any clarification.

Finally, there are other physics oriented ray tracers listed in

> <https://physics.stackexchange.com/questions/6682/software-for-geometrical-optics/166351#166351>

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 5, 2018, 10:40pm UTC](https://discourse.julialang.org/t/geometric-ray-tracing/17182/3 "2018-11-05T22:40:55Z")

</div>

Very cool! I think we’d want to first get all the parts right before moving into GUI interactivity (but gladly later on). Julia-wise I think we can help each other implement stuff in an efficient way, algorithm-wise I’ll gladly accept any help you can give. I personally, coming from vision in animals, would like to include the freaky optics from biology (non-spherical surfaces, multiple half transparent retinas, optical systems without a clear cardinal point, off axis asymmetrical systems, GRIN lenses, polarization, wavelength, etc).

Come join the issues in [DynamicalBilliards.jl](https://github.com/JuliaDynamics/DynamicalBilliards.jl/issues/175) and/or the #dynamics-bridged on slack!
