Great -- should be the same as the original.
All I did was take the integral of that loop.
(Probably the first thing I've ever used calculus for in real life)
Also, the implementation is exactly the same for the Vector2 version, but with Vector2 instead of Vector3 I just didn't post it here.