Skip to content

Commit

Permalink
sage.geometry, sage.manifolds: Add # optional - pplpy, numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Mar 11, 2023
1 parent 444a124 commit 325f072
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
29 changes: 16 additions & 13 deletions src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,25 @@ class ParametrizedSurface3D(SageObject):
sage: u2min, u2max = 0, 6.28
sage: u1num, u2num = 10, 20
sage: # make the arguments array
sage: from numpy import linspace
sage: u1_array = linspace(u1min, u1max, u1num)
sage: u2_array = linspace(u2min, u2max, u2num)
sage: u_array = [ (uu1,uu2) for uu1 in u1_array for uu2 in u2_array]
sage: from numpy import linspace # optional - numpy
sage: u1_array = linspace(u1min, u1max, u1num) # optional - numpy
sage: u2_array = linspace(u2min, u2max, u2num) # optional - numpy
sage: u_array = [(uu1,uu2) for uu1 in u1_array for uu2 in u2_array] # optional - numpy
sage: # Find the gaussian curvature
sage: K(u1,u2) = ellipsoid.gauss_curvature()
sage: # Make array of K values
sage: K_array = [K(uu[0],uu[1]) for uu in u_array]
sage: K(u1,u2) = ellipsoid.gauss_curvature() # optional - numpy
sage: # Make array of K values # optional - numpy
sage: K_array = [K(uu[0],uu[1]) for uu in u_array] # optional - numpy
sage: # Find minimum and max of the Gauss curvature
sage: K_max = max(K_array)
sage: K_min = min(K_array)
sage: K_max = max(K_array) # optional - numpy
sage: K_min = min(K_array) # optional - numpy
sage: # Make the array of color coefficients
sage: cc_array = [ (ccc - K_min)/(K_max - K_min) for ccc in K_array ]
sage: points_array = [ellipsoid_equation(u_array[counter][0],u_array[counter][1]) for counter in range(0,len(u_array)) ]
sage: curvature_ellipsoid_plot = sum( point([xx for xx in points_array[counter]],color=hue(cc_array[counter]/2)) for counter in range(0,len(u_array)) )
sage: curvature_ellipsoid_plot.show(aspect_ratio=1)
sage: cc_array = [(ccc - K_min)/(K_max - K_min) for ccc in K_array] # optional - numpy
sage: points_array = [ellipsoid_equation(u_array[counter][0],u_array[counter][1])
....: for counter in range(0,len(u_array))]
sage: curvature_ellipsoid_plot = sum(point([xx for xx in points_array[counter]], # optional - numpy, sage.plot
....: color=hue(cc_array[counter]/2))
....: for counter in range(0,len(u_array)))
sage: curvature_ellipsoid_plot.show(aspect_ratio=1) # optional - numpy, sage.plot
We can find the principal curvatures and principal directions of the
elliptic paraboloid::
Expand Down
28 changes: 14 additions & 14 deletions src/sage/manifolds/subsets/pullback.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,23 @@ def _is_open(codomain_subset):
PPL polyhedra and not-necessarily-closed polyhedra::
sage: from ppl import Variable, C_Polyhedron, NNC_Polyhedron, Constraint_System
sage: u = Variable(0)
sage: v = Variable(1)
sage: CS = Constraint_System()
sage: CS.insert(0 < u)
sage: CS.insert(u < 1)
sage: CS.insert(0 < v)
sage: CS.insert(v < 1)
sage: CS.insert(u + v <= 3) # redundant inequality
sage: P = NNC_Polyhedron(CS); P
sage: from ppl import Variable, C_Polyhedron, NNC_Polyhedron, Constraint_System # optional - pplpy
sage: u = Variable(0) # optional - pplpy
sage: v = Variable(1) # optional - pplpy
sage: CS = Constraint_System() # optional - pplpy
sage: CS.insert(0 < u) # optional - pplpy
sage: CS.insert(u < 1) # optional - pplpy
sage: CS.insert(0 < v) # optional - pplpy
sage: CS.insert(v < 1) # optional - pplpy
sage: CS.insert(u + v <= 3) # redundant inequality # optional - pplpy
sage: P = NNC_Polyhedron(CS); P # optional - pplpy
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 point, 4 closure_points
sage: ManifoldSubsetPullback._is_open(P)
sage: ManifoldSubsetPullback._is_open(P) # optional - pplpy
True
sage: CS.insert(u + v <= 1)
sage: T = NNC_Polyhedron(CS); T
sage: CS.insert(u + v <= 1) # optional - pplpy
sage: T = NNC_Polyhedron(CS); T # optional - pplpy
A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 point, 3 closure_points
sage: ManifoldSubsetPullback._is_open(T)
sage: ManifoldSubsetPullback._is_open(T) # optional - pplpy
False
"""
Expand Down

0 comments on commit 325f072

Please sign in to comment.