Byungchul Cha wrote:
> 
> I am using sage for my calc III students. The following short code
> produces about 500 points on a sphere.
> 
> pts=[]; number_of_points=500
> for t1 in srange(0, pi, n(pi/sqrt(number_of_points))):
>   for t2 in srange(0, 2*pi, n(2*pi/sqrt(number_of_points))):
>     pts.append((sin(t1)*cos(t2), sin(t1)*sin(t2), cos(t1)))
> show(point(pts))
> 
> My question is, though, that sage takes, it seems to me, longer time
> to execute this than I would expect. (CPU time: 6.66 s,  Wall time:
> 48.84 s) Am I making some stupid mistake in the above code, or sage
> does something unnecessary, which causes the delay? In my (naive)
> point of view, plotting as many as 500 points shouldn't take that long
> time... Thanks.

Try putting
   from math import sin, cos
before the rest of your code to use the double precision C-library's
sin and cosine functions instead.

William


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to