This is a simulation of AC powered RC circuit.
It can be used to study phase between voltage of capacitor, voltage of resistor and voltage of AC power supply .
The current and voltage are 90 degree out of phase.
The voltage in capacitor is proportional to charge ,
However, change need to be charged by current . ().
So current is leading charge (90 degree earlier).
And voltage in resistor is proportional to current .
Voltage in R ()is leading Voltage in capacitor()
The following simulation assume,