ddg.geometry.projections module
Module containing projections, e.g. central and stereographic.
A word on projection functions: Central projection is usually defined as a map between two k-planes S1, S2 in RPn via another, (n-k-1)-dim. subspace C disjoint from S1, S2. The projection maps x in S1 to meet(S2, join(x, S1)) and this is a well-defined bijective map and a projective transformation. In this module, we take a more general approach: If objects Y and C are given, we map any object X to meet(Y, join(X, C)).
- ddg.geometry.projections.central_project_subspace_onto_subspace(subspace, target_subspace, center)[source]
- Parameters:
- subspaceSubspace
If possible, the basis of the resulting subspace will consist of the projections of the basis points of
subspace. For this to work, target_subspace.dimension+center.dimension must be equal to ambient_dimension-1 and they must be disjoint. Otherwise, this function simply returns meet(target_subspace, join(subspace, center)).- target_subspaceSubspace
- centerSubspace
- Returns:
- Subspace
- ddg.geometry.projections.central_project_quadric_onto_subspace(quadric, subspace, center)[source]
- Parameters:
- quadricQuadric
- target_subspaceSubspace
- centerSubspace
- Returns:
- Quadric
- Raises:
- NotImplementedError
If quadric is not contained in a subspace.
- ddg.geometry.projections.central_project_subspace_onto_quadric(subspace, quadric, center)[source]
- Parameters:
- subspaceSubspace
Subspace to be projected.
- quadricQuadric
Quadric to project onto.
- centerSubspace
Projection center.
- Returns:
- Subspace
- ddg.geometry.projections.central_project(object_, target, center)[source]
Central projection dispatcher.
- ddg.geometry.projections.central_project_subspace_onto_subspace_contour(subspace, target_subspace, center)[source]
Central project subspace onto subspace (contour mode).
If image is a proper subspace of
target_subspace, returns the regular central projection. If image is all of target_subspace, returns the empty subspace.- Parameters:
- subspace, target_subspace, centerSubspace
- Returns:
- Subspace
- ddg.geometry.projections.central_project_quadric_onto_subspace_contour(quadric, subspace, center)[source]
Central project quadric onto subspace (contour version).
This function also supports quadrics in the whole space.
- Parameters:
- quadricQuadric
- subspaceSubspace
- centerPoint
- Returns:
- Quadric
- Raises:
- NotImplementedError
If
quadricis in the whole space andcenteris not a point.
- ddg.geometry.projections.central_project_subspace_onto_quadric_contour(subspace, quadric, center)[source]
Central project subspace onto quadric (contour mode).
If image is a proper subset of
quadric, returns image. If image is all ofquadric, returns an empty quadric.- Parameters:
- subspaceSubspace
- quadricQuadric
- centerSubspace
- Returns:
- Quadric
- ddg.geometry.projections.central_project_contour(object_, target, center)[source]
Central projection dispatcher (contour mode).
This returns the boundary of the shadow instead of the shadow itself, so to speak.
- ddg.geometry.projections.central_project_quadric_onto_subspace_complex(quadric, subspace, center)[source]
Central project quadric onto subspace (complex version).
If we also consider complex intersections of lines through
centerwithquadric, the projection image will always be all of subspace (or the intersection ofsubspacewithquadric.subspace).- Parameters:
- quadricQuadric
- subspaceSubspace
- centerSubspace
- Returns:
- Subspace
- ddg.geometry.projections.central_project_complex(object_, target, center)[source]
Central projection dispatcher (complex mode).
- ddg.geometry.projections.stereographic_project(object_)[source]
- ddg.geometry.projections.stereographic_project(subspace: Subspace, hyperplane=None, projection_point=None)
- ddg.geometry.projections.stereographic_project(quadric: Quadric, hyperplane=None, projection_point=None)
Stereographic projection (Quadric to subspace) dispatcher.
Accepts different keyword arguments based on type. See the type-specific functions for details.
- ddg.geometry.projections.stereographic_project_subspace(subspace, hyperplane=None, projection_point=None)[source]
- Parameters:
- subspaceSubspace
Subspace to be projected.
If this is the projection point itself, returns
inf.- hyperplaneSubspace or None (default=None)
Hyperplane not containing
projection_point. Default is the plane spanned by the homogeneous vectors e_1,…,e_n-1, e_{n+1}.- projection_pointPoint or None (default=None)
Point to project from. Default is the “north pole” [e_n+e_{n+1}].
- Returns:
- Subspace or float
- ddg.geometry.projections.stereographic_project_quadric(quadric, hyperplane=None, projection_point=None)[source]
- Parameters:
- quadricQuadric
Quadric to be projected.
- hyperplaneSubspace or None (default=None)
Hyperplane not containing
projection_point. Default is the plane spanned by the homogeneous vectors e_1,…,e_n-1, e_{n+1}.- projection_pointPoint or None (default=None)
Point to project from. Default is the “north pole” [e_n+e_{n+1}].
- Returns:
- Quadric
- ddg.geometry.projections.inverse_stereographic_project(object_)[source]
- ddg.geometry.projections.inverse_stereographic_project(point: Point, quadric=None, projection_point=None)
- ddg.geometry.projections.inverse_stereographic_project(subspace: Subspace, quadric=None, projection_point=None)
- ddg.geometry.projections.inverse_stereographic_project(sphere: SphereLike, quadric=None, projection_point=None)
Inverse stereographic projection (Subspace to Quadric) dispatcher.
Accepts different keyword arguments based on type. See the type-specific functions for details.
- ddg.geometry.projections.inverse_stereographic_project_point(point, quadric=None, projection_point=None)[source]
- Parameters:
- pointPoint
Point to project.
- quadricQuadric or None (default=None)
Quadric to project onto. Default is the Möbius quadric.
- projection_pointPoint
Center of projection. Default is the “north pole” [e_n+e_{n+1}].
- Returns:
- Point
- Raises:
- ValueError
If
projection_pointdoes not lie onquadric.
Notes
This is separate from inverse_stereographic_project_subspace because in this case there is an explicit formula and because of some special cases.
- ddg.geometry.projections.inverse_stereographic_project_subspace(subspace, quadric=None, projection_point=None)[source]
- Parameters:
- subspaceSubspace
Subspace to project.
- quadricQuadric or None (default=None)
Quadric to project onto. Default is the Möbius quadric.
- projection_pointPoint
Center of projection. Default is the “north pole” [e_n+e_{n+1}].
- Returns:
- Quadric
- Raises:
- ValueError
If
projection_pointdoes not lie onquadric.
- ddg.geometry.projections.inverse_stereographic_project_sphere(sphere, quadric=None, projection_point=None)[source]
Stereographically project a sphere contained in a subspace to a quadric.
Works in all cases in which planar sections of
quadricare stereographically projected to spheres (in the sense of the Euclidean metric in affine coordinates) in sphere.subspace.- Parameters:
- sphereEuclidean sphere
- quadricQuadric or None (default=None)
- projection_pointPoint or None (default=None)
Center of projection. Default is the “north pole” [e_n+e_{n+1}].
- Returns:
- Quadric
- Raises:
- NotImplementedError
If the intersection of sphere.subspace and the tangent plane at projection_point is not at infinity.
If the induced metric is distorted, i.e. planar sections of the quadric would not map to spheres in sphere.subspace.
If the intersection of the line through projection_point and polarize(sphere.subspace) with sphere.subspace is at infinity. This point would normally act as a sort of origin.
- ValueError
If
projection_pointdoes not lie onquadric.
Notes
This function uses the euclidean distance on a quadric of signature (n+1, 1) given by:
d([x], [y])^2 = -1/2 * <x,y>/(<x,p><y,p>)
for a point [p] on the quadric with a fixed representative vector. We use that formula to find all points a constant distance from a point. This set will be a planar section of the quadric.
This metric corresponds to the Euclidean metric in affine coordinates after stereographic projection, but only to certain subspaces via certain points. We have to determine whether we have such a case and then find the right representative vector
pto get the right scaling.See supplemental material for details.
- ddg.geometry.projections.lift_sphere_to_quadric(sphere, quadric, projection_point)[source]
Find the lift of a sphere to a quadric via a point.
This is the inverse of the following map: Map a planar section of
quadrictoquadric.polarize(projection_point)viaprojection_point, giving a Cayley-Klein sphere.Because the inverse map (the projection) is a double cover, this will always return two quadrics.
- Parameters:
- sphereCayleyKleinSphere
- quadricQuadric
Quadric to lift to.
- projection_pointPoint
A point not on the quadric.
- Returns:
- Quadric, Quadric
- Raises:
- ValueError
If projection_point is on the quadric
If center of sphere does not lie in
quadric.polarize(projection_point).If no preimage exists. This is the case if the center of the sphere does not lie in the projection image of the quadric.
Notes
Taken from
Non-Euclidean Laguerre Geometry and Incircular Nets, page 43.