System and method for determining and adjusting positioning and orientation of a surgical device