]> CRI, Mines Paris - PSL - linpy.git/blobdiff - examples/squares.py
Update documentation to match __repr__() changes
[linpy.git] / examples / squares.py
index 15aed1699bb7eda9f1d8659041ebf4a4a049ba0a..1a0cedb7af0fd0fd40ce46a3c41fd4afa79326b7 100755 (executable)
@@ -31,7 +31,7 @@ if __name__ == '__main__':
     shell.push('square2')
     shell.push()
 
     shell.push('square2')
     shell.push()
 
-    shell.push('inter = square1.intersection(square2)')
+    shell.push('inter = square1.intersection(square2) # or square1 & square2')
     shell.push('inter')
     shell.push()
 
     shell.push('inter')
     shell.push()
 
@@ -39,18 +39,19 @@ if __name__ == '__main__':
     shell.push('hull')
     shell.push()
 
     shell.push('hull')
     shell.push()
 
-    shell.push('square1.project([y])')
+    shell.push('proj = square1.project([y])')
+    shell.push('proj')
     shell.push()
 
     shell.push('inter <= square1')
     shell.push('inter == Empty')
     shell.push()
 
     shell.push()
 
     shell.push('inter <= square1')
     shell.push('inter == Empty')
     shell.push()
 
-    shell.push('union = square1 | square2')
+    shell.push('union = square1.union(square2) # or square1 | square2')
     shell.push('union')
     shell.push('union <= hull')
     shell.push()
 
     shell.push('union')
     shell.push('union <= hull')
     shell.push()
 
-    shell.push('diff = square1 - square2')
+    shell.push('diff = square1.difference(square2) # or square1 - square2')
     shell.push('diff')
     shell.push('~square1')
     shell.push('diff')
     shell.push('~square1')