"Fossies" - the Fresh Open Source Software Archive

Member "jas-2.6/examples/alg_surface.rb" (29 Sep 2011, 531 Bytes) of package /linux/privat/jas-2.6.5988-src.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #
    2 # jruby examples for jas.
    3 # $Id: alg_surface.rb 3784 2011-09-29 20:52:24Z kredel $
    4 #
    5 
    6 require "examples/jas"
    7 
    8 # polynomial examples: 
    9 
   10 Yr = EF.new(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build();
   11 #puts "Yr    = " + str(Yr);
   12 #puts
   13 
   14 one,x,y,z = Yr.gens();
   15 puts "one   = " + str(one);
   16 puts "x     = " + str(x);
   17 puts "y     = " + str(y);
   18 puts "z     = " + str(z);
   19 puts;
   20 
   21 f = (1+z)*(1-z); # / ( x**2 + y**2 );
   22 puts "f     = " + str(f);
   23 puts;
   24 
   25 g = f / (1 - z); 
   26 puts "g     = " + str(g);
   27 puts;
   28 
   29 #startLog();
   30 terminate();