Omitir navegación.
Inicio

Conversión de Grados a Radianes y viceversa

  • strict warning: Non-static method view::load() should not be called statically in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/views.module on line 1113.
  • strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_field.inc on line 1147.
  • strict warning: Declaration of views_handler_argument::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_argument::query() should be compatible with views_handler::query($group_by = false) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_handler_area::query() should be compatible with views_handler::query($group_by = false) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_area.inc on line 81.
  • strict warning: Declaration of views_handler_area_text::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/handlers/views_handler_area_text.inc on line 121.
  • strict warning: Declaration of views_plugin_argument_validate::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /var/www/vhosts/obdnet.com/subdomains/ruby/httpdocs/modules/views/plugins/views_plugin_argument_validate.inc on line 87.

 # Conversión de Grados a Radianes y viceversa

def formulas

STDOUT.flush

puts "Elije la unidad de medida GRADOS o RADIANES"

puts "Presiona G o R:  "

STDOUT.flush

unidad= gets.chomp

@t1 = unidad.upcase

@pi=3.1416

if @t1 == "g" or @t1=="G"

puts "Escribe los grados a convertir:  "

STDOUT.flush

cantidad= gets.chomp

@can = cantidad.to_i

puts "Has elegido #{@t1} = Grados"

puts "Vas a convertir #{cantidad} de grados a Radianes"

fa=(2.0*@pi*@can/360)

puts

puts "Solucion:"

puts "#{cantidad} de grados equivalen a #{fa} Radianes"

salir

end

 

if @t1 == "r" or @t1=="R"

puts "Has elegido #{@t1} = Radianes"

puts "Vas a convertir #{cantidad} de radianes a grados"

puts "Escribe los radianes a convertir:  "

STDOUT.flush

cantidad = gets.chomp.to_f

ca =(360*cantidad)/(2*@pi)

puts

puts "Solucion:"

puts "#{cantidad} de radianes equivalen a #{ca} grados"

salir

end

 

end

 

def salir

puts "Quieres salir??? (s/n)  "

STDOUT.flush

salir = gets.chomp

 

if salir == "n" or salir == "N"

formulas

end

 

end

 

formulas

 

puts

puts "Adios..........."

 

AdjuntoTamaño
conversorgradosradianes.rb1.08 KB