Hi, welcome to the forum.
It is safer to use a transformer : http://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter
If you want to measure up to 260 VAC, you need a transformer that is for 260 VAC or for higher voltages.
That schematic is drawn in a bad way. I have doubts with the circuit itself as well. The capacitors reduce the noise from the VCC, but any inaccuracy of VCC is not compensated. When you would use an internal reference of the Arduino, that circuit brings the inaccuracy of VCC into it.
You can start with: Line — 2M — 2M — (a)— 15k — (b)
At point “(a)” two clamping diodes. For example a 1N4148 to GND and to VCC, like in the schematic.
From point “(a)” a 1k resistor to analog input, like in the schematic.
From analog input to GND a capacitor of 4.7nF.
Point “(b)” should be half way of the maximum span. In this case about 1V.
You can use resistors for that (somewhat like the schematic).
It is also possible to replace the 15k with the resistors of the voltage divider.
If two or three things fail, the current through the 2M resistor can’t damage the Arduino. That is good.
I have a very big problem with the safety. Is someone supervising you ?
Do you know how to make a circuit for 260VAC mains voltages ?
What about the ground ? Is the other Line connected to arduino GND ? That is not possible, you will destroy the Arduino and the computer when you connect a computer to the Arduino.
I found your circuit. It is in the TI Application Report SLAA391.
[EDIT]: I added about point “(b)”, I forgot about that. And I found the schematic in the SLAA391 document.
[EDIT2]: I started wrong with the resistors, but I don’t want to delete this post. Is it for school and you only need it to work in the simulator or are you going to build it ? Then I would like to know which Arduino board and if the 5V is accurate.