I am developing a Monte Carlo simulation for an elliptical reflector. A light source is usually placed at the f1 of the ellipsoid and all rays after getting reflected from the reflector pass through f2. But we need to check the effects of changing the position of the source. Hence, I need to know that what will be the direction vector of reflected ray if a ray is emitted from an arbitrary point inside the ellipsoid. If I know the direction vector of the reflected ray then I can find the points trough which it will pass after getting reflected ( I want this!). I know how to find the point of intersection between the ellipsoid and incoming rays. Using this intersection point, I have tried finding out the angle between the tangent plane and the incoming ray. We know the angle of incidence and reflection will be the same. But I am unable to solve the problem. All I want is the direction vector for the reflected ray. Any help will be appreciated. Thanks! P.S: I am using MATLAB
Asked
Active
Viewed 242 times
0
-
Do you have the normal vector of the tangent plane at the point of reflection? – tomi Nov 16 '19 at 18:13
-
yes I guess we can find it simply by subtracting the angle between the tangent and incoming ray from pi (90 degrees) ? This should give us the angle between normal and the incoming ray. – Muhammad Taha Manzoor Nov 16 '19 at 20:01
-
Look here: https://math.stackexchange.com/questions/13261/how-to-get-a-reflection-vector – tomi Nov 16 '19 at 20:53
-
Thank you I just need to ask that what do they mean by normalization of n? – Muhammad Taha Manzoor Nov 16 '19 at 22:20
-
I tried their method but it seems not to work my rays must converge at f2. but it is not happening – Muhammad Taha Manzoor Nov 16 '19 at 22:41
-
It is working now – Muhammad Taha Manzoor Nov 16 '19 at 22:55
-
There is but of error tough, but I rays seem to converge around f2 Thanks a lot for your help – Muhammad Taha Manzoor Nov 16 '19 at 22:56
-
To normalise n, you divide it by its magnitude so that it is has magnitude 1. – tomi Nov 17 '19 at 02:59