You'll have to create a function in Ruby to do this. Since you're already using Compass, you can take advantage of the Sassy Math extension. Their Ruby code for this function looks like this (hope I've got the right one here):
def atan2(y, x)
y = y.value.to_f
x = x.value.to_f
result = Math.atan2(y, x)
Sass::Script::Number.new(result)
end