ddg.geometry.moebius_models module
Möbius geometry module.
Contains model classes and functions for conversion between the models.
- class ddg.geometry.moebius_models.ProjectiveModel(dimension)[source]
Bases:
_TemplateProjective model of Möbius geometry.
Model space
The Möbius quadric is the quadric with matrix
diag([1,...,1, -1]), which can be thought of as the unit sphere.Representation of objects
Spheres in this model are represented by quadrics which are intersections of the Möbius quadric with a subspace.
- Parameters:
- dimensionint
- Attributes:
- dimensionint
- property absolute
The absolute quadric with matrix
diag([1,...,1, -1]).- Returns:
- Quadric
- property ambient_dimension
- angle(s1, s2)
Angle between two Möbius spheres.
- Parameters:
- s1, s2Quadric
Möbius spheres.
- Returns:
- float
- cayley_klein_distance(v, w)
Alias for self.absolute.cayley_klein_distance.
- cayley_klein_sphere(center, radius, subspace=None, atol=None, rtol=None)
Create a Cayley-Klein sphere.
- Parameters:
- centerPoint or numpy.ndarray of shape (n+1,)
- radiusfloat
Cayley-Klein radius
- subspaceSubspace or list of numpy.ndarray of shape (k,) (default=None)
- Returns:
- CayleyKleinSphere
- generalized_cayley_klein_sphere(center, radius, subspace=None, atol=None, rtol=None)
Create a generalized Cayley-Klein sphere.
- Parameters:
- centerPoint or numpy.ndarray of shape (n+1,)
- radiusfloat
Generalized radius
- subspaceSubspace or list of numpy.ndarray of shape (k,) (default=None)
- Returns:
- GeneralizedCayleyKleinSphere
- inner_product(v, w)
Alias for self.absolute.inner_product.
- pole_of_sphere(sphere)
Return pole corresponding to sphere.
- Parameters:
- sphereQuadric
- Returns:
- Subspace
- class ddg.geometry.moebius_models.ParaboloidModel(dimension)[source]
Bases:
_TemplateParaboloid model of Möbius geometry.
Model space
The Möbius quadric is the quadric with matrix:
I | --+----- | 0 1 | 1 0
Which can be thought of as a paraboloid.
Representation of objects
Spheres in this model are represented by quadrics which are intersections of the Möbius quadric with a subspace.
- Parameters:
- dimensionint
- Attributes:
- dimensionint
- property absolute
The absolute quadric.
Returns the quadric with matrix
I | --+----- | 0 1 | 1 0
- Returns:
- Quadric
- property ambient_dimension
- angle(s1, s2)
Angle between two Möbius spheres.
- Parameters:
- s1, s2Quadric
Möbius spheres.
- Returns:
- float
- cayley_klein_distance(v, w)
Alias for self.absolute.cayley_klein_distance.
- cayley_klein_sphere(center, radius, subspace=None, atol=None, rtol=None)
Create a Cayley-Klein sphere.
- Parameters:
- centerPoint or numpy.ndarray of shape (n+1,)
- radiusfloat
Cayley-Klein radius
- subspaceSubspace or list of numpy.ndarray of shape (k,) (default=None)
- Returns:
- CayleyKleinSphere
- generalized_cayley_klein_sphere(center, radius, subspace=None, atol=None, rtol=None)
Create a generalized Cayley-Klein sphere.
- Parameters:
- centerPoint or numpy.ndarray of shape (n+1,)
- radiusfloat
Generalized radius
- subspaceSubspace or list of numpy.ndarray of shape (k,) (default=None)
- Returns:
- GeneralizedCayleyKleinSphere
- inner_product(v, w)
Alias for self.absolute.inner_product.
- pole_of_sphere(sphere)
Return pole corresponding to sphere.
- Parameters:
- sphereQuadric
- Returns:
- Subspace
- class ddg.geometry.moebius_models.EuclideanModel[source]
Bases:
objectEuclidean model of Möbius geometry.
Model space
The model space is Euclidean space together with a single point at infinity, which we represent by
float('inf').Representation of objects
Möbius Spheres in this model are Euclidean spheres or subspaces (spheres with center at infinity).
- ddg.geometry.moebius_models.euclidean_to_projective(object_, embedded=False)[source]
Convert from Euclidean model to projective model.
This function works by embedding into the equatorial plane, then projecting stereographically.
- Parameters:
- object_Subspace or SphereLike
Object in n-dimensional ambient space.
- embeddedbool (default=False)
If False,
object_is embedded into the equatorial plane before projecting.
- Returns:
- Quadric
An intersection of the Möbius quadric with a subspace in (n+1)-dimensonal ambient space.
- ddg.geometry.moebius_models.projective_to_euclidean(object_, embedded=False)[source]
Convert a Möbius sphere to a Euclidean sphere or subspace.
This function works by projecting stereographically to the equatorial plane, then computing coordinates.
- Parameters:
- object_Quadric
Intersection of Möbius quadric with a subspace, all in (n+1)-dim. ambient space.
- embeddedbool (default=False)
Whether to return the object in the equatorial plane or in n-dim. ambient space.
- Returns:
- SphereLike or Subspace
- ddg.geometry.moebius_models.paraboloid_to_projective_and_back(object_)[source]
Convert between projective and paraboloid models.
Transform an object with the transformation that takes the projective model quadric to the paraboloid model quadric. This transformation is an involution, i.e. applying it again is the same as undoing the transformation. The transformation is
I | ---+--------------------- | 1/sqrt(2) 1/sqrt(2) | 1/sqrt(2) -1/sqrt(2)
Where I is the identity matrix of the appropriate size.
- Parameters:
- object_Transformable
- Returns:
- object_type(object_)
Transformed
object_.
Warning
This WILL mutate
object_.