Good Morning John,,
Before we begin with this trap, Please accept my deepest appology as it appears I made a grevious error on the layout. When I wrote the text description for the line to the right hand side of the main drain I was mistakenly thinking the sink on the far end was a bathroom lavatory sink.
A tub/shower is rated at 2DFU and a lavatory(1DFU) would have made the combined load 3DFU which is the maximum allowable load on a 1-1/2" line, however while reading this post I realized that the sink is a kitchen sink, not a lavatory sink, therefore the sink is also 2DFU so the combined load downstream of the Wye at the tub location is 4DFU's and will require a 2" output on the Wye and a 2" line from the wye to the main drain.
I have edited both the text and isometric in the previous post to show the correction.
Now for your trap...
See Attached Illustration:
When computing both pitch and length the critical point of a trap is the "Trap Weir". The trap weir is the point where the inverted U section of the trap turns horizontal and where the water actually spills out of the trap and into the drain line. The term 'Weir" is derived from the proper name of a spillway for a dam.
The actual depth of standing water in a trap is predetermined by the manufacturers design for the trap, however, for the sake of illustration I have pointed out that the code requires the standing water depth of a trap to be a minimum of 2" and not more than 4" vertical when measured from the top of the trap Dip to the trap Weir.
By necessity a fixture arm is wet vented from the vented drain or stack to the trap. In order to insure proper venting the code establishes a minimum length from the vent to the trap weir of 2 x the pipe diameter.
Under the International Residential Code the maximum length of a fixture arm in feet can be computed by dividing the pipe diameter by the required pitch. A 3" drain line may be pitched at 1/8" per foot with the expressed written consent of your local inspector, but as a rule all lines 3" or less must be pitched at 1/4" per foot.
As you can see from the illustration the bottom of the pipe at the trap weir may not be higher than the top of the pipe at the vent opening.
Your Tub/shower drain is an 1-1/2" line which requires a 1/4" per foot pitch so the maximum length would be 1.5" / .25" = 6 feet.
You can also see that the actual elevation of your trap will be determined by the length of the trap arm.
Once you have established the elevation of the trap you extend a vertical riser from the trap input to the tub Waste & Overflow output however, with the singular exception of a laundry standpipe, the vertical rise from the trap input to the actual drain opening may not exceed 24". (Some local codes limit this to 12").