Raytracing in Rust!

I have started a project that requires the use of a raytracer. Basically, I hope to make a library for rendering optical paths using raytracing and simulate the result that one would get by looking through the optical system. Hopefully, I would like to be able to write somewhere that I will have a couple of lenses here and there, give the parameters such as the refractive index and curvatures and diameters and get the resulting image on a focal plane. To do this, I need to start small, and I thought that the way to start small was to …

Continue Reading

My simple genetic algorithm in Python for polynomial curve fitting

Take the shortest route, the one that nature planned Marcus Aurelius, Meditations Genetic algorithms are really interesting in my opinion. Not the most efficient, but rather beautiful in the way they work. I especially like them because of the similarities that they share with life. Genetic algorithms are special kind of algorithms that work by modelling how natural selection works in the real world. I shouldn’t need to explain how evolution works, but for the sake of it, here I go. We have several individuals in a population, given their environment, some of the individual are better suited and reproduce, …

Continue Reading

Diffraction patterns in astronomical imaging

The first image from the James Webb Space Telescope (JWST) was uncover a few days ago [1]. This is truely an incredible image, showing the galactic cluster SMACS 0723, which is slowly becoming the de-facto target for newly deployed space telescopes as it was imaged by Hubble, Planck and Chandra before JWST. This image in particular took the JWST 12.5 hours of exposure to be able to see these objects as they are so dim in the sky. The best way to see how much of an achievement this is, is to compare it to the previous picture, taken by …

Continue Reading

A new surprising sorting algorithm

Just a small post today. I stumbled upon a paper [1] on ArXiv recently on a surprising sorting algorithm that was discovered pretty recently (in October 2021). Here is a quick implementation I wrote in Python: It’s not the most efficient algorithm obviously, as it will always do n2 comparisons. It is an O(n2) algorithm in the best case and worst case scenario. There are much more advanced algorithms out there that go down to O(n log n) in average, so much faster and more efficient. This algorithm is more like a curiosity, based on how simply the sorting is …

Continue Reading