Triangle \( \triangle XYZ \) is similar to triangle \( \triangle ABC \). If \( XY = 9 \) units, \( YZ = 12 \) units, and \( BC = 18 \) units, what is the length of segment \( AB \)? Let's think step by step and output the final answer within \boxed{}.
user