look: I study C/C++ in the college, but Ruby I study by myself, I want
to write a first course program in Ruby(it was a C code of a shell
trajectory, launched by user's speed and angle). I've already written
the program in Ruby, it calculates the shell position at every period of
time.The output looks like
give angle(degrees):
45
give speed(km/h)
150
convert degrees to radian:
0.785398163397448
flight trajectory:
x=106.066017177982 y=101.166017177982
x=212.132034355964 y=192.532034355964
x=318.198051533946 y=274.098051533946
x=424.264068711928 y=345.864068711929
x=530.330085889911 y=407.830085889911
x=636.396103067893 y=459.996103067893
x=742.462120245875 y=502.362120245875
x=848.528137423857 y=534.928137423857
x=954.594154601839 y=557.694154601839
x=1060.66017177982 y=570.660171779821
x=1166.7261889578 y=573.826188957803
x=1272.79220613579 y=567.192206135786
x=1378.85822331377 y=550.758223313768
x=1484.92424049175 y=524.52424049175
x=1590.99025766973 y=488.490257669732
x=1697.05627484771 y=442.656274847714
x=1803.1222920257 y=387.022292025696
x=1909.18830920368 y=321.588309203678
x=2015.25432638166 y=246.35432638166
x=2121.32034355964 y=161.320343559642
x=2227.38636073762 y=66.4863607376246
x=2333.45237791561 y=-38.1476220843933
ok, now I need to make it "alive". In C/C++ I can, but in Ruby, I have
no idea.
Therefore I need a piece of code which creates a window and point a
ball(it will be the shell). Any ideas?
--
Posted via http://www.ruby-forum.com/.