Day 3, Casting rays into spheres
Finally some practical applications of the math heavy weekend, casting abstract rays at abstract spheres. Well, on a sliding scale from linear algebra to physical representation, it’s still a step in the direction.
More reasonable pace, now that we’ve entered the workdays part of the week, with just an hour of coding-while-breakfast, that I didn’t realize I had missed so much. It must have been during Devember 2016, while I was at a conference for a third of it, and because westward transatlantic jetlag was awake a few hours ahead of the conference schedule. I sat in the hotel lobby, eating expensive and not that good nuked oatmeal for breakfast, and working on my Devember project. That Devember project didn’t work out, but that week was great.
Oh, back to casting rays at spheres. I guess this can’t stay around forever:
class Sphere
...
def intersect(_ray)
raise NotImplementedError
end
...
end
Next related
Day 4, Intersections
More math heavy stuff, calculating the positions along a ray, where it intersects a sphere. Turns out this is as simple as solving a quadratic equation, with some special coefficients.
Previous related
Day 2, Matrices, matrices, matrices. Oh, and more matrices
Today was spent on a heavy chunk of linear algebra, matrices. This is the foundation for everything else, so time well spent reimplementing what’s already in the stdlib, just to refresh my math skills. If there are still days left of Devember when I’m finished, I’ll come back and replace all this with the stdlib implementation instead, hoping I’m somewhat close to the same API.
Day 1, Overdoing it
The first proper day of Devember is here. Of course I overdid it and spent all day coding, instead of just that one hour.
Day 0, Tuple Basics
Oops, I started a day early.