If unobstructed, why not?
1017.3 Measurement
Exit access travel distance shall be measured from the most remote point within a story along the natural and unobstructed path of horizontal and vertical egress travel to the entrance to an exit.
Exception: In open parking garages, exit access travel distance is permitted to be measured to the closest riser of an exit access stairway or the closest slope of an exit access ramp.
Measure along the natural and unobstructed path.... unless obstructed, do you walk at perfect right angles? I'd say that the "natural" path is straight line from A to B.