Simply reversed & combined
a behaves like b as c to x
a : b = c : x
x = b × c ÷ a
x = b × c ÷ a = 6 × 9 ÷ 3
18