P-trap

Code said the distance from trap arm to soil/waste stack is not allowed to turn more than 135 degree. In horizontal plane only or counting in both vertical and horizontal ?
For example, from p-trap, arm goes to wall drop vertical down 6" and change to horizontal before connect to stack. Thanks