Module: Ultimate::Extensions::SassScriptFunctions
- Included in:
- Sass::Script::Functions
- Defined in:
- lib/ultimate/extensions/sass_script_functions.rb
Instance Method Summary collapse
Instance Method Details
#polar(x, y) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/ultimate/extensions/sass_script_functions.rb', line 6 def polar(x, y) assert_type x, :Number assert_type y, :Number theta = Sass::Script::Number.new(Math.atan2(y.value, x.value) / Math::PI * 180 + 90) r = Sass::Script::Number.new(Math.hypot(x.value, y.value)) Sass::Script::List.new([theta, r], :comma) end |