I am developing a ray tracer and I need to compute intersections between many surfaces and rays. A classical method to make the computation time lower and the code simpler is to define some constants in surfaces equations (for example a sphere is centered at the origin and has a radius of 1) but apply some transformations (scale, rotate and translate) to get the correct result. Being a newbie in maths, I started to experiment before coding and found some strange things I can't explain.
First, let's talk about translation. I reduced the problem to a 2D world to be clearer. Here $\vec{v}$ is the direction vector of the thrown ray $\Delta$. THis ray should intersect with the circle centered at B. To go from the first circle to the second circle we made a center translation using $\vec{u}$, so to move the ray into the object space we just have to apply a translation of $-\vec{u} = \vec{u'}$ on one of its point. It then gives the correct result.
It seems that there's no problem for translation. Now I want to do the same operation with scaling. Here I scaled my circle isotropically by 3. And then I do not know how to transform the ray into object space.
I tried to use matrices, but I probably messed up a bit so I didn't find a working solution. Any ideas ?