From: brabuhr@... Date: 2009-12-05T00:10:08+09:00 Subject: Re: Graphics mode again On Fri, Dec 4, 2009 at 8:37 AM, Teodor Carstea wrote: >>Hi, all! here is my prog: it calculates the trajectory of a cannon shell: > [...] >>this is the output if speed=45km/h and angle=45 degrees > >  give angle(degrees): > 45 >  give speed(km/h) > 45 >  convert degrees to radian: > 0.785398163397448 >  flight trajectory: > x=31.8198051533946  y=26.9198051533946 > x=63.6396103067893  y=44.0396103067893 > x=95.4594154601839  y=51.3594154601839 > x=127.279220613579  y=48.8792206135786 > x=159.099025766973  y=36.5990257669732 > x=190.918830920368  y=14.5188309203678 > x=222.738636073762  y=-17.3613639262375 > >>help me to see it, I mean, a graphic application (or console application), or >whatever... I want to see a shell flying on the screen. I am able to do it in >>C++, but I wanna make it in Ruby, how can I use graphics mode? Google: ruby gnome canvas http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gnome+Canvas+Clock Based on that: #!/usr/bin/env ruby require 'gnomecanvas2' class Foozle < Gtk::Window def initialize super @canvas = Gnome::Canvas.new(true) @foozle = Gnome::CanvasEllipse.new( @canvas.root, { :x1 => 10, :y1 => 20, :x2 => 30, :y2 => 40, :fill_color => "white", :outline_color => "steelblue", :width_pixels => 1 } ) @canvas.show add(@canvas) end end Gtk.init() Foozle.new.show Gtk.main() Draws a single ball on the screen. There are of course (as others have pointed out) other libraries that may be more or less suited to your needs.