Re: [sage-support] Re: Computational geometry in the plane: in Sage?

2014-04-25 Thread Ed Scheinerman
Thanks. I've seen some of that, but it looks like they use the upper 
half-plane model for visualization (while my preference is for Poincare 
disk). Also, I want to do other geometric constructions/visualizations in 
Sage (see attached pics) for which commands to create segments, then get 
perpentidular bisecting lines  or angle trisectors, would make life much 
easier. (I did this in Sage, but had to work from scratch.)





On Thursday, April 24, 2014 5:43:57 PM UTC-4, Peter Bruin wrote:

 A certain amount of work on adding functionality for hyperbolic geometry 
 to Sage has been done in recent years, see here:

 http://trac.sagemath.org/ticket/9439

 There seem to be several different implementations by different authors; I 
 am not sure about the status of all this work and how much of it is 
 relevant to what you want to do.

 Peter


 Op donderdag 24 april 2014 18:54:32 UTC+1 schreef Ed Scheinerman:

 Glad to see this has gained some traction. Here is an illustration of the 
 immediate issue for which this would have been helpful. I wanted to produce 
 an illustration explaining lines in the hyperbolic plane using the Poincare 
 disk model. It's the arc of a circle whose end points are on a given circle 
 and the arc meets the given circle at right angles. (That's a lot to say 
 but a picture makes it so much easier.) 

 It took me a long time and a good deal of coding in Sage to get this how 
 I wanted. My gut tells me there's go to be a better way!


 On Thu, Apr 24, 2014 at 9:31 AM, Volker Braun vbrau...@gmail.com wrote:

 We do have convex hull and lines. What would be lacking for your 
 application are discs and their intersection with polyhedra.

 sage: line = Polyhedron(vertices=[(0,-1)], lines=[(1,1)])
 sage: (triangle  line).vertices()
 (A vertex at (8/5, 3/5), A vertex at (3/2, 1/2))


 On Thursday, April 24, 2014 7:02:21 AM UTC+1, Dominique Laurain wrote:

 I need same packages that Ed asked for.
 Nowadays I do geometry coding myself basic functions in SAGE worksheets 
 (to do intersection of lines etc).
 I do this using the Rational Trigonometry philosophy :-)..see 
 njwilderger youtube videos and book.
 Previously I played a little with Tex tools (pst-tricks and 
 pst-eucl)..check about pstricks too...at that time and until now, I
 was interested with tilings.
 In SAGE we have the basics tools (vectors,matplotlib...) but I feel 
 there are not the intermediate tools : convex hull, rules and compass 
 constructions, origami tools and so on.
 I can code some (for example, convex hull: I know an algorithm paquet 
 cadeau ...but everytime I feel to reinvent wheel.
 What is not enough with Tex is that all is static : for example, you 
 cannot have the generic solution of two lines AB and CD where A,B,C,D are 
 2D points with variables coordinates...because it is no more static 
 geometry but symbolic computations (solving equations / inequations).


  -- 
 You received this message because you are subscribed to a topic in the 
 Google Groups sage-support group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/sage-support/Y0t4ShFLXJ4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 sage-support...@googlegroups.com.
 To post to this group, send email to sage-s...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Ed Scheinerman (e...@scheinerman.net) 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


tangent-ring.pdf
Description: Adobe PDF document


morley.pdf
Description: Adobe PDF document


circum-out.pdf
Description: Adobe PDF document


Re: [sage-support] Re: Computational geometry in the plane: in Sage?

2014-04-24 Thread Ed Scheinerman
Glad to see this has gained some traction. Here is an illustration of the
immediate issue for which this would have been helpful. I wanted to produce
an illustration explaining lines in the hyperbolic plane using the Poincare
disk model. It's the arc of a circle whose end points are on a given circle
and the arc meets the given circle at right angles. (That's a lot to say
but a picture makes it so much easier.)

It took me a long time and a good deal of coding in Sage to get this how I
wanted. My gut tells me there's go to be a better way!


On Thu, Apr 24, 2014 at 9:31 AM, Volker Braun vbraun.n...@gmail.com wrote:

 We do have convex hull and lines. What would be lacking for your
 application are discs and their intersection with polyhedra.

 sage: line = Polyhedron(vertices=[(0,-1)], lines=[(1,1)])
 sage: (triangle  line).vertices()
 (A vertex at (8/5, 3/5), A vertex at (3/2, 1/2))


 On Thursday, April 24, 2014 7:02:21 AM UTC+1, Dominique Laurain wrote:

 I need same packages that Ed asked for.
 Nowadays I do geometry coding myself basic functions in SAGE worksheets
 (to do intersection of lines etc).
 I do this using the Rational Trigonometry philosophy :-)..see
 njwilderger youtube videos and book.
 Previously I played a little with Tex tools (pst-tricks and
 pst-eucl)..check about pstricks too...at that time and until now, I
 was interested with tilings.
 In SAGE we have the basics tools (vectors,matplotlib...) but I feel there
 are not the intermediate tools : convex hull, rules and compass
 constructions, origami tools and so on.
 I can code some (for example, convex hull: I know an algorithm paquet
 cadeau ...but everytime I feel to reinvent wheel.
 What is not enough with Tex is that all is static : for example, you
 cannot have the generic solution of two lines AB and CD where A,B,C,D are
 2D points with variables coordinates...because it is no more static
 geometry but symbolic computations (solving equations / inequations).


  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/Y0t4ShFLXJ4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.




-- 
Ed Scheinerman (e...@scheinerman.net)

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


line-definition.pdf
Description: Adobe PDF document


[sage-support] Computational geometry in the plane: in Sage?

2014-04-20 Thread Ed Scheinerman
Does Sage have, or is there a package I can add, that implements basic 
plane geometry objects and operations. The sort of thing I'd like to do is, 
given two points, construct the line that contains them. Or given two 
circles, intersect them yielding 0, 1, or 2 points. Given a set of points, 
determine which are on the convex hull, construct that polygon, and return 
its area. And, ultimately, after working with various geometric objects, 
perhaps visualize them on the screen (but that comes later). 

Extra bonus if I can do this in both the Euclidean plane and the Hyperbolic 
plane (and in the latter case visualize either in the Poincare disk or the 
upper half plane models). 

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage on Mavericks requesting installation of X

2013-10-31 Thread Ed Scheinerman
Yes. I reinstalled the same version of XQuartz as I had before, but it was 
the first such reinstall since upgrading to Mavericks.

On Wednesday, October 30, 2013 12:41:23 AM UTC-4, yomcat wrote:


 On 30/10/2013, at 0945, Ed Scheinerman edward.sc...@gmail.comjavascript: 
 wrote: 

  Update: I re-installed XQuartz and the problem vanished. 

 Was this the first time you re-installed KQuartz after installing 
 Mavericks? 

 Apple requires such a thing with every new major OS X upgrade, I do 
 believe. 


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Sage on Mavericks requesting installation of X

2013-10-29 Thread Ed Scheinerman
Update: I re-installed XQuartz and the problem vanished. 

On Monday, October 28, 2013 5:44:42 PM UTC-4, Ed Scheinerman wrote:

 I have just upgraded my Mac to OS X version 10.9 Mavericks and am 
 running Sage version 5.12. When I start sage from the command line an 
 dialogue box opens asking me about opening Xquartz and that X11 is no 
 longer supported etc. (See attached image.) I can dismiss past this 
 dialogue box and all works fine. I have XQuartz installed and I get this 
 error whether or not I already have Xquartz running. 

 Anything I should do to make this annoyance stop?


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Sage on Mavericks requesting installation of X

2013-10-28 Thread Ed Scheinerman
I have just upgraded my Mac to OS X version 10.9 Mavericks and am running 
Sage version 5.12. When I start sage from the command line an dialogue box 
opens asking me about opening Xquartz and that X11 is no longer supported 
etc. (See attached image.) I can dismiss past this dialogue box and all 
works fine. I have XQuartz installed and I get this error whether or not I 
already have Xquartz running. 

Anything I should do to make this annoyance stop?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.
attachment: needs-X.png

[sage-support] Trouble saving graphics

2013-09-07 Thread Ed Scheinerman
I'm using Sage 5.11 on a Mac

I've been used to creating graphs and then saving them as PDF's for 
inclusion in papers. Using code like this:

sage: g = graphs.PetersenGraph()
sage: pic = g.plot()
sage: pic.save('pete.pdf')

But now it just throws a bunch of errors:

---
AssertionErrorTraceback (most recent call last)
ipython-input-56-d63f9d409a56 in module()
 1 pic.save('pete.pdf')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
 
in wrapper(*args, **kwds)
456 kwds[self.name + options] = suboptions
457 
-- 458 return func(*args, **kwds)
459 
460 #Add the options specified by @options to the signature of 
the wrapped

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
 
in save(self, filename, **kwds)
   2753 figure.savefig(filename, dpi=dpi, 
bbox_inches='tight',
   2754 bbox_extra_artists=self._bbox_extra_artists,
- 2755 transparent=transparent)
   2756 else:
   2757 figure.savefig(filename, dpi=dpi,

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
 
in savefig(self, *args, **kwargs)
   1368 kwargs.setdefault('edgecolor', 
rcParams['savefig.edgecolor'])
   1369 
- 1370 self.canvas.print_figure(*args, **kwargs)
   1371 
   1372 if transparent:

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
 
in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, 
format, **kwargs)
   2053 orientation=orientation,
   2054 dryrun=True,
- 2055 **kwargs)
   2056 renderer = self.figure._cachedRenderer
   2057 bbox_inches = self.figure.get_tightbbox(renderer)

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
 
in print_pdf(self, *args, **kwargs)
   1846 from backends.backend_pdf import FigureCanvasPdf # lazy 
import
   1847 pdf = self.switch_backends(FigureCanvasPdf)
- 1848 return pdf.print_pdf(*args, **kwargs)
   1849 
   1850 def print_pgf(self, *args, **kwargs):

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py
 
in print_pdf(self, filename, **kwargs)
   2299  width, height, image_dpi, 
RendererPdf(file, image_dpi),
   2300 
 bbox_inches_restore=_bbox_inches_restore)
- 2301 self.figure.draw(renderer)
   2302 renderer.finalize()
   2303 finally:

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
 
in draw_wrapper(artist, renderer, *args, **kwargs)
 52 def draw_wrapper(artist, renderer, *args, **kwargs):
 53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
 55 after(artist, renderer)
 56 

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
 
in draw(self, renderer)
   1004 dsu.sort(key=itemgetter(0))
   1005 for zorder, a, func, args in dsu:
- 1006 func(*args)
   1007 
   1008 renderer.close_group('figure')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
 
in draw_wrapper(artist, renderer, *args, **kwargs)
 52 def draw_wrapper(artist, renderer, *args, **kwargs):
 53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
 55 after(artist, renderer)
 56 

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/axes.pyc
 
in draw(self, renderer, inframe)
   2084 
   2085 for zorder, a in dsu:
- 2086 a.draw(renderer)
   2087 
   2088 renderer.close_group('axes')

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
 
in draw_wrapper(artist, renderer, *args, **kwargs)
 52 def draw_wrapper(artist, renderer, *args, **kwargs):
 53 before(artist, renderer)
--- 54 draw(artist, renderer, *args, **kwargs)
 55 after(artist, renderer)
 56 

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/collections.pyc
 
in draw(self, renderer)
693 (np.sqrt(x) * self.figure.dpi / 72.0))
694 for x in self._sizes]
-- 695 return Collection.draw(self, renderer)
696 
697 class PolyCollection(Collection):

/Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
 
in draw_wrapper(artist, renderer, *args, **kwargs)
 52 def draw_wrapper(artist, renderer, *args, **kwargs):
 53 before(artist, renderer)
--- 54 

[sage-support] Re: Trouble saving graphics

2013-09-07 Thread Ed Scheinerman
I found a temporary workaround. Save as .eps (which works fine) and then 
use epstopdf to convert to .pdf. 

On Saturday, September 7, 2013 12:01:40 PM UTC-4, P Purkayastha wrote:

 It seems saving to pdf is broken on sage-5.10 onwards. Works till 
 sage-5.9. The problem is only in graphs. Normal plots work fine. 

 I have opened http://trac.sagemath.org/ticket/15173 to track this. 

 On 09/07/2013 09:06 PM, Ed Scheinerman wrote: 
  I'm using Sage 5.11 on a Mac 
  
  I've been used to creating graphs and then saving them as PDF's for 
  inclusion in papers. Using code like this: 
  
  sage: g = graphs.PetersenGraph() 
  sage: pic = g.plot() 
  sage: pic.save('pete.pdf') 
  
  But now it just throws a bunch of errors: 
  
  
 --- 
  AssertionErrorTraceback (most recent call 
 last) 
  ipython-input-56-d63f9d409a56 in module() 
   1 pic.save('pete.pdf') 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/misc/decorators.pyc
  

  in wrapper(*args, **kwds) 
   456 kwds[self.name + options] = suboptions 
   457 
  -- 458 return func(*args, **kwds) 
   459 
   460 #Add the options specified by @options to the signature 
  of the wrapped 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/sage/plot/graphics.pyc
  

  in save(self, filename, **kwds) 
  2753 figure.savefig(filename, dpi=dpi, 
  bbox_inches='tight', 
  2754 
 bbox_extra_artists=self._bbox_extra_artists, 
  - 2755 transparent=transparent) 
  2756 else: 
  2757 figure.savefig(filename, dpi=dpi, 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
  

  in savefig(self, *args, **kwargs) 
  1368 kwargs.setdefault('edgecolor', 
  rcParams['savefig.edgecolor']) 
  1369 
  - 1370 self.canvas.print_figure(*args, **kwargs) 
  1371 
  1372 if transparent: 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
  

  in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, 
  format, **kwargs) 
  2053 orientation=orientation, 
  2054 dryrun=True, 
  - 2055 **kwargs) 
  2056 renderer = self.figure._cachedRenderer 
  2057 bbox_inches = 
 self.figure.get_tightbbox(renderer) 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc
  

  in print_pdf(self, *args, **kwargs) 
  1846 from backends.backend_pdf import FigureCanvasPdf # lazy 
  import 
  1847 pdf = self.switch_backends(FigureCanvasPdf) 
  - 1848 return pdf.print_pdf(*args, **kwargs) 
  1849 
  1850 def print_pgf(self, *args, **kwargs): 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py
  

  in print_pdf(self, filename, **kwargs) 
  2299  width, height, 
  image_dpi, RendererPdf(file, image_dpi), 
  2300 
bbox_inches_restore=_bbox_inches_restore) 
  - 2301 self.figure.draw(renderer) 
  2302 renderer.finalize() 
  2303 finally: 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
  

  in draw_wrapper(artist, renderer, *args, **kwargs) 
52 def draw_wrapper(artist, renderer, *args, **kwargs): 
53 before(artist, renderer) 
  --- 54 draw(artist, renderer, *args, **kwargs) 
55 after(artist, renderer) 
56 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/figure.pyc
  

  in draw(self, renderer) 
  1004 dsu.sort(key=itemgetter(0)) 
  1005 for zorder, a, func, args in dsu: 
  - 1006 func(*args) 
  1007 
  1008 renderer.close_group('figure') 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
  

  in draw_wrapper(artist, renderer, *args, **kwargs) 
52 def draw_wrapper(artist, renderer, *args, **kwargs): 
53 before(artist, renderer) 
  --- 54 draw(artist, renderer, *args, **kwargs) 
55 after(artist, renderer) 
56 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/axes.pyc
  

  in draw(self, renderer, inframe) 
  2084 
  2085 for zorder, a in dsu: 
  - 2086 a.draw(renderer) 
  2087 
  2088 renderer.close_group('axes') 
  
  
 /Users/ers/share/sage-5.11/local/lib/python2.7/site-packages/matplotlib/artist.pyc
  

  in draw_wrapper(artist, renderer, *args, **kwargs) 
52 def draw_wrapper(artist, renderer

[sage-support] Limit with gamma function gives incorrect answer

2013-08-06 Thread Ed Scheinerman
When I try this:

sage: y = gamma(x+1/2)/gamma(x)/sqrt(x)
sage: limit(y,x=oo)
0
sage: plot(y,x,1,50)

I observe that the limit appears to be 1, not 0. 

Indeed, Mathematica confirms:

In[1]:= y = Gamma[x + 1/2]/(Gamma[x]*Sqrt[x])
Out[1]= Gamma[1/2 + x]/(Sqrt[x] Gamma[x])

In[2]:= Limit[y, x - Infinity]
Out[2]= 1

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Error summing inverses of binomial coefficients

2013-07-17 Thread Ed Scheinerman
I am looking to evaluate $\sum_{k=0}^n 1/\binom{n}{k}$ so I type:

sage: n = var('n')
sage: k = var('k')
sage: sum(1/binomial(n,k),k,0,n)
(n + 1)*2^(-n)

and that answer is wrong.

For example, with n=10 we get

sage: sum(1/binomial(10,k) for k in range(11))
1433/630

but the alleged answer of (n+1)*2^(-n) is 11/1024.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Problems upgrading to 5.9 on Ubunutu using apt-get

2013-05-06 Thread Ed Scheinerman
I'm using Ubuntu 13.04 and am having trouble upgrading to 5.9. I get this 
error message:

W: Failed to fetch 
http://ppa.launchpad.net/aims/sagemath/ubuntu/dists/raring/main/binary-amd64/Packages
 

Ideas?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Problems upgrading to 5.9 on Ubunutu using apt-get

2013-05-06 Thread Ed Scheinerman
Working great. Thank you!!

On Monday, May 6, 2013 9:39:31 AM UTC-4, Jan Groenewald wrote:

 Hi

 These 64bit packages are now copied aqnd available in quantal and raring 
 from the PPA.
 Please test and let us know.

 Regards,
 Jan





 On 6 May 2013 13:42, Jan Groenewald j...@aims.ac.za javascript: wrote:

 Hi

 There is only a binary built on 12.04. This binary works on 12.04 and 
 12.10, and I hope on 13.04.
 I've uploaded 5.9 64bit to the PPA for 12.04, but not yet the other 
 versions. I've just now copied the
 packages on the PPA over to 12.10 and 13.04 -- this might take a while 
 (minutes? hours?) to complete.
 Note from 5.9 on this is 64bit only.

 32bit for raring 13.04 is available from the sagemath.org binary 
 download section.

 Regards,
 Jan



 On 6 May 2013 13:02, Ed Scheinerman edward.sc...@gmail.com javascript:
  wrote:

 I'm using Ubuntu 13.04 and am having trouble upgrading to 5.9. I get 
 this error message:

 W: Failed to fetch 
 http://ppa.launchpad.net/aims/sagemath/ubuntu/dists/raring/main/binary-amd64/Packages
  

 Ideas?

 Thanks.

 -- 
 You received this message because you are subscribed to the Google 
 Groups sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to sage-support...@googlegroups.com javascript:.
 To post to this group, send email to sage-s...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/sage-support?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




 -- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 
  



 -- 
   .~. 
   /V\ Jan Groenewald
  /( )\www.aims.ac.za
  ^^-^^ 
  

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Question about scoping

2012-01-17 Thread Ed Scheinerman
I'm confused by the fact that variables defined inside functions can
leak out and become global variables. Here's what I've noticed.

(1) I create a file called steiner.py for finding the Steiner point
given three points in the plane. Here's my code:


def dist(p,q):

Eulidean distance between two points

n = len(p)
d2 = sum( (p[k]-q[k])**2 for k in range(n) )
return sqrt(d2)

def steiner(a,b,c):

Given three points in the plane, find the point p that minimizes
the sum of the distances to those three points.

x = var('x')
y = var('y')
p = (x,y)  # unknown point

# objective function to minimize
obj = dist(p,a) + dist(p,b) + dist(p,c)

# start search at center of mass of the three points
p0 = ( (a[0]+b[0]+c[0])/3., (a[1]+b[1]+c[1])/3. )

print Starting optimiztion at, p0
print obj.subs(x=p0[0], y=p0[1])

return minimize(obj,p0)


(2) I attach this file in a Sage session. If I have global variables x
or y, they are wiped out when I invoke the steiner function. Here's a
transcript.


$ sage
--
| Sage Version 4.7.2, Release Date: 2011-10-29   |
| Type notebook() for the GUI, and license() for information.|
--
sage: attach steiner.py
sage: x = [1,2,3]
sage: y = [4,5,6]
sage: x
[1, 2, 3]
sage: y
[4, 5, 6]
sage: steiner((1,1), (2,3), (5,2))
Starting optimiztion at (2.6665, 2.0)
5.4788343901030965
Optimization terminated successfully.
 Current function value: 5.303240
 Iterations: 6
 Function evaluations: 7
 Gradient evaluations: 7
(2.20179756615, 2.46316721759)
sage: x
x
sage: y
y

My apologies if this is something already covered, but it's confusing
and not the behavior I would expect. Other variables defined inside
functions don't leak out like this.


-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org