I want to replace a tub with a shower, and the location where I'd like to put the drain has a 2" drain pipe (for the clothes washing machine) that runs very close to where I want to put the drain. So I would like to essentially have the shower drain P-trap come down so close it could almost touch the washer drain line, then just after the P-trap I would need to make essentially a 180-degree curve to turn the line around and go back to the washer drain line where I would have to tie in with a wye curve. This is in a floor joist space, so I have limited room without cutting through more joists (which I would like to avoid if possible)
In this rough drawing (a top view looking down) the green is the existing 2" drain pipe for the washer that I want to connect the new shower drain into, and the purple is the rough pipe location for the new shower drain I am asking about. The blue parts are floor joists. It isn't to scale--the curvy part would likely use all of the available space between the joists, but I hope it gets the point across--it would immediately curve after the p-trap.
Am I allowed (code) to have so many immediate curves in the horizontal portion of the shower drain? Once the line comes back up from the P-trap, the nearly-horizontal line will essentially make a 225 degree curve (180 degree plus 45 degree wye) to get to into the washer drain line pipe. Thanks.