File: alg_surface.py

package info (click to toggle)
jas 2.7.200-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,732 kB
  • sloc: java: 164,370; python: 14,882; ruby: 14,509; xml: 583; makefile: 545; sh: 349
file content (40 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# jython examples for jas.
# $Id$
#

import sys

from java.lang import System
from java.lang import Integer

from jas import Ring
from jas import PolyRing
from jas import Ideal
from jas import QQ, AN, RF, EF
from jas import terminate
from jas import startLog

# polynomial examples: 

Yr = EF(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build();
#print "Yr    = " + str(Yr);
#print

[one,x,y,z] = Yr.gens();
print "one   = " + str(one);
print "x     = " + str(x);
print "y     = " + str(y);
print "z     = " + str(z);
print;

f = (1+z)*(1-z); # / ( x**2 + y**2 );
print "f     = " + str(f);
print;

g = f / (1 - z); 
print "g     = " + str(g);
print;

#startLog();
terminate();