I don't know which code you're under, but it wouldn't pass code here. And I wouldn't want the two 90's even if it did pass. For a continuous waste and vent system, you need a tee, not a wye in the stack.
Two 45 degree ells and a tee and it's much better. Or, you can turn the tee to 45 degrees, and use a single 45 degree ell to head straight to the toilet, though it means an elongated hole in the joist. And you can keep it up in the floor joists. As to the distance, again, I don't know which code you're under - the codes differ. Under the Uniform Plumbing Code, the distance for 3" trap arms is 6', the distance for 4" trap arms is 10 feet.