Looking at your side view, if we call going to the left the positive x-direction (opposite typical, just to keep the numbers positive), going up the page the positive z-direction, and going into the page the positive y-direction, the unit vector directions of the various vent segments starting at the floor are:
A (0,0,1) (true vertical rise)
B (1/sqrt(2),0,1/sqrt(2) (45 degree bend to the left)
C (1/2, 1/2, 1/sqrt(2)) (45 degrees off plumb, but going "NW" as seen in the top view)
D (1,0,0) (horizontal, we are ignoring the 2% slope required)
[Note for each vector, x^2 + y^2 + z^2 = 1, i.e. it's a unit vector. Note also that the requirement that the direction is at most 45 degrees off plumb is the same as the requirement that the unit vector's z-component is at least 1/sqrt(2).]
So now to compute the bend angles we can take the dot product (pairwise multiplication, then summation) and then the arccos of that is the bend angle. Start with A-B for proof of concept:
A dot B = (0 * 1/sqrt(2) + 0 * 0 + 1 * 1/sqrt(2)) = 1/sqrt(2) ; arccos = 45 degrees
B dot C = (1/sqrt(2) * 1/2 + 0 * 1/2 + 1/sqrt(2) * 1/sqrt(2)) = 1/2sqrt(2) + 1/2; arccos = 31.4 degrees
C dot D = (1/2 + 0 + 0) = 1/2 ; arccos = 60 degrees.
The upshot is that as drawn the red circle is the easy one, you can use a 60 degree bend; for the B-to-C transition, you'd need to get (2) 22.5s and fiddle with them to get 31.4 degrees. If you are currently using a 45 degree bend for B-to-C, then either (a) you have it so that projected from above it is a 45 degree turn in plan (the way you drew it), but now direction C is more than 45 off vertical or (b) you have it so that it stays at 45 degrees off plumb, but now in plan the apparent bend is more than 45 degrees.
Cheers, Wayne