# Problem in ray diagrams in convex mirrors

I just found out about the Desmos online graphing calculator, and it is really a very nice tool. Just while playing with it, I had the idea of creating simulations. I decided to make a simulation of the ray daigrams of the convex mirrors. I tried twice and I failed twice. But I cannot find the cause. I have checked every calculation about 3 times and still I cannot make it.

But let me tell the main problem. In my fist simulation, I found out that when I used the basic laws of reflection (i=r), The ray parellel to the principal axis does not meet the axis at the focus. Example: In this image, we can see that when the ray is at height of 0.5 (units), the ray passes the principal axis just before the focus.

In the second simulation, I used the laws of drawing the ray diagrams as given in my book.

1. A ray that is parallel to the principle axis, on reflection will pass through the focus.
2. A ray through the center retraces its path in the opposite direction after reflection.

In this one, the problem comes when the object is placed at the Center of curvature. According to my physics book, the image should be formed at C and it should be of the same size as the object. Here the image is formed at C but the image is larger than the object. In this image we can see that the object is 0.6 units high but the image is 1 unit.

Here are the links to the simulations:

I'm sorry, I did not show my calculation of the equations in the simulations but they can be derived very easily.

So then where did I go wrong? Why am I not getting the correct answer??