~ubuntu-branches/ubuntu/trusty/mayavi2/trusty

« back to all changes in this revision

Viewing changes to docs/source/mayavi/auto/boy.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-07-09 01:18:36 UTC
  • mfrom: (1.1.10 upstream) (2.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110709011836-fha21zirlgkqh92s
Tags: 4.0.0-1
* New upstream release
* debian/control:
  - Bump Standards-Version to 3.9.2
  - Set X-Python-Version: 2.6, fixes FTBFS (Closes: #625148)
  - Update Depends
* Update debian/watch file
* Cleanup debian/rules file

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
The boy surface is a mathematical parametric surface, see
5
5
http://en.wikipedia.org/wiki/Boy%27s_surface . We display it by sampling
6
6
the two parameters of the surface on a grid and using the mlab's mesh
7
 
function: :func:`enthought.mayavi.mlab.mesh`.
 
7
function: :func:`mayavi.mlab.mesh`.
8
8
"""
9
9
 
10
 
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org> 
 
10
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
11
11
# Copyright (c) 2007, Enthought, Inc.
12
12
# License: BSD Style.
13
13
 
14
14
 
15
 
from numpy import sin, cos, mgrid, pi, sqrt 
16
 
from enthought.mayavi import mlab
 
15
from numpy import sin, cos, mgrid, pi, sqrt
 
16
from mayavi import mlab
17
17
 
18
18
mlab.figure(fgcolor=(0, 0, 0), bgcolor=(1, 1, 1))
19
19
u, v = mgrid[-0.035:pi:0.01, -0.035:pi:0.01]
20
20
 
21
 
X = 2/3.* (cos(u)* cos(2*v) 
 
21
X = 2/3.* (cos(u)* cos(2*v)
22
22
        + sqrt(2)* sin(u)* cos(v))* cos(u) / (sqrt(2) - sin(2*u)* sin(3*v))
23
23
Y = 2/3.* (cos(u)* sin(2*v) - sqrt(2)* sin(u)* sin(v))* cos(u) / (sqrt(2)
24
24
        - sin(2*u)* sin(3*v))