Two objects are moving in different direction. Under what circumstances can you treat this as one-dimensional problem?

If they are both moving along the same straight line.