Code of the Week 2023
Code of the Week 2023
Week 1.0:
The difference between z coordinate of the exact solution and the z coordinate of output produced should be less than 10^-7.
Edits for clarification:
If the origin of the ray lies on the surface then it is not considered a point of intersection for the purposes of this question.
If there are two or more points of intersection then the program can output any one of them and be considered correct.
The input can contain decimals for origin of the ray and direction of the ray.
The code should run under 0.3 seconds after direction in z axis has been entered.
Hint: Don’t try to find exact mathematical solution. This can be solved by using one of concepts you learned in class 12th array chapters. The algorithm is not the same but the concept is.
Submit your solutions after output of your program matches with the output of the given exe file. This is a command line program .
Correction: The original executable file showed inconsistent behavior when origin of the ray was on the surface. This has been fixed.
Link to the windows executable file of the solution
This is a .exe file not a python script. Reverse engineering to get the source code won't be easy.