ddg.geometry package
Submodules
- ddg.geometry.abc module
- ddg.geometry.elliptic_models module
ProjectiveModelProjectiveModel.absoluteProjectiveModel.metric_to_cayley_klein_distance()ProjectiveModel.cayley_klein_distance_to_metric()ProjectiveModel.moebius()ProjectiveModel.to_moebius()ProjectiveModel.from_moebius()ProjectiveModel.sphere_through_points()ProjectiveModel.orthogonal_sphere()ProjectiveModel.ambient_dimensionProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.d()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.inner_product()ProjectiveModel.sphere()
SphericalModelSphericalModel.fixed_pointSphericalModel.d()SphericalModel.absoluteSphericalModel.ambient_dimensionSphericalModel.angle()SphericalModel.cayley_klein_distance()SphericalModel.cayley_klein_sphere()SphericalModel.elliptic()SphericalModel.elliptic_pointSphericalModel.elliptic_subspaceSphericalModel.euclidean()SphericalModel.euclidean_pointSphericalModel.euclidean_subspaceSphericalModel.from_elliptic()SphericalModel.from_euclidean()SphericalModel.from_hyperbolic()SphericalModel.from_hyperbolic_half_space()SphericalModel.from_hyperbolic_poincare()SphericalModel.from_lie()SphericalModel.from_paraboloid()SphericalModel.generalized_cayley_klein_sphere()SphericalModel.hyperbolic()SphericalModel.hyperbolic_half_space()SphericalModel.hyperbolic_poincare()SphericalModel.hyperbolic_pointSphericalModel.hyperbolic_subspaceSphericalModel.inner_product()SphericalModel.lie()SphericalModel.paraboloid()SphericalModel.pole_of_sphere()SphericalModel.sphere_from_pole()SphericalModel.to_elliptic()SphericalModel.to_euclidean()SphericalModel.to_hyperbolic()SphericalModel.to_hyperbolic_half_space()SphericalModel.to_hyperbolic_poincare()SphericalModel.to_lie()SphericalModel.to_paraboloid()
spherical_to_projective()projective_to_spherical()
- ddg.geometry.euclidean_models module
ProjectiveModelProjectiveModel.absoluteProjectiveModel.d()ProjectiveModel.angle()ProjectiveModel.moebius()ProjectiveModel.to_moebius()ProjectiveModel.from_moebius()ProjectiveModel.laguerre()ProjectiveModel.to_laguerre()ProjectiveModel.from_laguerre()ProjectiveModel.angle_bisectors()ProjectiveModel.angle_bisector_orientation_preserving()ProjectiveModel.angle_bisector_orientation_reversing()ProjectiveModel.perpendicular_bisector()ProjectiveModel.reflect_in_hyperplane()ProjectiveModel.ellipse_from_foci()ProjectiveModel.sphere()ProjectiveModel.sphere_through_points()ProjectiveModel.sphere_from_affine_point_and_normals()ProjectiveModel.orthogonal_sphere()ProjectiveModel.radical_subspace()ProjectiveModel.sphere_to_quadric()ProjectiveModel.quadric_to_sphere()ProjectiveModel.ambient_dimensionProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.inner_product()
DualProjectiveModelDualProjectiveModel.absoluteDualProjectiveModel.angle()DualProjectiveModel.laguerre()DualProjectiveModel.to_laguerre()DualProjectiveModel.from_laguerre()DualProjectiveModel.ambient_dimensionDualProjectiveModel.cayley_klein_distance()DualProjectiveModel.cayley_klein_sphere()DualProjectiveModel.generalized_cayley_klein_sphere()DualProjectiveModel.inner_product()
MoebiusModelMoebiusModel.fixed_pointMoebiusModel.d()MoebiusModel.absoluteMoebiusModel.ambient_dimensionMoebiusModel.angle()MoebiusModel.cayley_klein_distance()MoebiusModel.cayley_klein_sphere()MoebiusModel.elliptic()MoebiusModel.elliptic_pointMoebiusModel.elliptic_subspaceMoebiusModel.euclidean()MoebiusModel.euclidean_pointMoebiusModel.euclidean_subspaceMoebiusModel.from_elliptic()MoebiusModel.from_euclidean()MoebiusModel.from_hyperbolic()MoebiusModel.from_hyperbolic_half_space()MoebiusModel.from_hyperbolic_poincare()MoebiusModel.from_lie()MoebiusModel.from_paraboloid()MoebiusModel.generalized_cayley_klein_sphere()MoebiusModel.hyperbolic()MoebiusModel.hyperbolic_half_space()MoebiusModel.hyperbolic_poincare()MoebiusModel.hyperbolic_pointMoebiusModel.hyperbolic_subspaceMoebiusModel.inner_product()MoebiusModel.lie()MoebiusModel.paraboloid()MoebiusModel.pole_of_sphere()MoebiusModel.sphere_from_pole()MoebiusModel.to_elliptic()MoebiusModel.to_euclidean()MoebiusModel.to_hyperbolic()MoebiusModel.to_hyperbolic_half_space()MoebiusModel.to_hyperbolic_poincare()MoebiusModel.to_lie()MoebiusModel.to_paraboloid()
projective_to_moebius()moebius_to_projective()
- ddg.geometry.geometry_model_templates module
MetricGeometryCayleyKleinGeometryMetricCayleyKleinGeometryMetricCayleyKleinGeometry.metric_to_cayley_klein_distance()MetricCayleyKleinGeometry.cayley_klein_distance_to_metric()MetricCayleyKleinGeometry.d()MetricCayleyKleinGeometry.sphere()MetricCayleyKleinGeometry.ambient_dimensionMetricCayleyKleinGeometry.cayley_klein_distance()MetricCayleyKleinGeometry.cayley_klein_sphere()MetricCayleyKleinGeometry.generalized_cayley_klein_sphere()MetricCayleyKleinGeometry.inner_product()MetricCayleyKleinGeometry.absolute
- ddg.geometry.hyperbolic_models module
ProjectiveModelProjectiveModel.absoluteProjectiveModel.metric_to_cayley_klein_distance()ProjectiveModel.cayley_klein_distance_to_metric()ProjectiveModel.moebius()ProjectiveModel.to_moebius()ProjectiveModel.from_moebius()ProjectiveModel.poincare()ProjectiveModel.to_poincare()ProjectiveModel.from_poincare()ProjectiveModel.half_space()ProjectiveModel.to_half_space()ProjectiveModel.from_half_space()ProjectiveModel.geodesic()ProjectiveModel.perpendicular_subspace()ProjectiveModel.common_perpendicular()ProjectiveModel.d_point_hyperplane()ProjectiveModel.d_hyperplanes()ProjectiveModel.angle()ProjectiveModel.sphere_through_points()ProjectiveModel.orthogonal_sphere()ProjectiveModel.ambient_dimensionProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.d()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.inner_product()ProjectiveModel.sphere()
PoincareDiskModelHalfSpaceModelHemisphereModelHemisphereModel.fixed_pointHemisphereModel.d()HemisphereModel.absoluteHemisphereModel.ambient_dimensionHemisphereModel.angle()HemisphereModel.cayley_klein_distance()HemisphereModel.cayley_klein_sphere()HemisphereModel.elliptic()HemisphereModel.elliptic_pointHemisphereModel.elliptic_subspaceHemisphereModel.euclidean()HemisphereModel.euclidean_pointHemisphereModel.euclidean_subspaceHemisphereModel.from_elliptic()HemisphereModel.from_euclidean()HemisphereModel.from_hyperbolic()HemisphereModel.from_hyperbolic_half_space()HemisphereModel.from_hyperbolic_poincare()HemisphereModel.from_lie()HemisphereModel.from_paraboloid()HemisphereModel.generalized_cayley_klein_sphere()HemisphereModel.hyperbolic()HemisphereModel.hyperbolic_half_space()HemisphereModel.hyperbolic_poincare()HemisphereModel.hyperbolic_pointHemisphereModel.hyperbolic_subspaceHemisphereModel.inner_product()HemisphereModel.lie()HemisphereModel.paraboloid()HemisphereModel.pole_of_sphere()HemisphereModel.sphere_from_pole()HemisphereModel.to_elliptic()HemisphereModel.to_euclidean()HemisphereModel.to_hyperbolic()HemisphereModel.to_hyperbolic_half_space()HemisphereModel.to_hyperbolic_poincare()HemisphereModel.to_lie()HemisphereModel.to_paraboloid()
projective_to_poincare()poincare_to_projective()projective_to_hemisphere()hemisphere_to_projective()hemisphere_to_poincare()poincare_to_hemisphere()hemisphere_to_half_space()half_space_to_hemisphere()
- ddg.geometry.laguerre_models module
- ddg.geometry.lie_models module
ProjectiveModelProjectiveModel.absoluteProjectiveModel.moebius_pointProjectiveModel.moebius_subspaceProjectiveModel.moebius()ProjectiveModel.from_moebius()ProjectiveModel.to_moebius()ProjectiveModel.laguerre_pointProjectiveModel.laguerre_subspaceProjectiveModel.laguerre()ProjectiveModel.from_laguerre()ProjectiveModel.to_laguerre()ProjectiveModel.ambient_dimensionProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.inner_product()
- ddg.geometry.moebius_models module
ProjectiveModelProjectiveModel.absoluteProjectiveModel.paraboloid()ProjectiveModel.from_paraboloid()ProjectiveModel.euclidean_pointProjectiveModel.euclidean_subspaceProjectiveModel.to_paraboloid()ProjectiveModel.euclidean()ProjectiveModel.from_euclidean()ProjectiveModel.to_euclidean()ProjectiveModel.hyperbolic_pointProjectiveModel.hyperbolic_subspaceProjectiveModel.hyperbolic()ProjectiveModel.to_hyperbolic()ProjectiveModel.from_hyperbolic()ProjectiveModel.hyperbolic_poincare()ProjectiveModel.to_hyperbolic_poincare()ProjectiveModel.from_hyperbolic_poincare()ProjectiveModel.hyperbolic_half_space()ProjectiveModel.to_hyperbolic_half_space()ProjectiveModel.from_hyperbolic_half_space()ProjectiveModel.elliptic_pointProjectiveModel.elliptic_subspaceProjectiveModel.elliptic()ProjectiveModel.from_elliptic()ProjectiveModel.to_elliptic()ProjectiveModel.lie()ProjectiveModel.from_lie()ProjectiveModel.to_lie()ProjectiveModel.ambient_dimensionProjectiveModel.angle()ProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.inner_product()ProjectiveModel.pole_of_sphere()ProjectiveModel.sphere_from_pole()
ParaboloidModelParaboloidModel.absoluteParaboloidModel.ambient_dimensionParaboloidModel.angle()ParaboloidModel.cayley_klein_distance()ParaboloidModel.cayley_klein_sphere()ParaboloidModel.generalized_cayley_klein_sphere()ParaboloidModel.inner_product()ParaboloidModel.pole_of_sphere()ParaboloidModel.sphere_from_pole()
EuclideanModeleuclidean_to_projective()projective_to_euclidean()paraboloid_to_projective_and_back()
- ddg.geometry.signatures module
SignatureSignature.plusSignature.minusSignature.zeroSignature.matrixSignature.is_degenerateSignature.rankSignature.is_positive_definiteSignature.is_negative_definiteSignature.is_positive_semi_definiteSignature.is_negative_semi_definiteSignature.is_indefiniteSignature.is_definiteSignature.is_semi_definite
AffineSignatureAffineSignature.plusAffineSignature.minusAffineSignature.zeroAffineSignature.last_entryAffineSignature.matrixAffineSignature.is_definiteAffineSignature.is_degenerateAffineSignature.is_indefiniteAffineSignature.is_negative_definiteAffineSignature.is_negative_semi_definiteAffineSignature.is_positive_definiteAffineSignature.is_positive_semi_definiteAffineSignature.is_semi_definiteAffineSignature.rank
signature_from_diagonal()affine_signature_from_diagonal()projective_normalization()affine_normalization()SignatureSequenceJordanBlockIndexSequenceSegreSymbolrotate_left()rotate_right()inverse_order()find_complement()sort_by_signature()sort_by_jordanblock()normalform()complete_types_dictionary()
- ddg.geometry.spheres module
SphereLikeCayleyKleinSphereLikeCayleyKleinSphereLike.absoluteCayleyKleinSphereLike.metric_radius()CayleyKleinSphereLike.cayley_klein_radius()CayleyKleinSphereLike.generalized_radius()CayleyKleinSphereLike.at_infinity()CayleyKleinSphereLike.embed()CayleyKleinSphereLike.is_circle()CayleyKleinSphereLike.is_hypersphere()CayleyKleinSphereLike.quadric()CayleyKleinSphereLike.unembed()CayleyKleinSphereLike.centerCayleyKleinSphereLike.radiusCayleyKleinSphereLike.subspaceCayleyKleinSphereLike.geometryCayleyKleinSphereLike.dimensionCayleyKleinSphereLike.ambient_dimension
QuadricSphereCayleyKleinSphereCayleyKleinSphere.metric_radius()CayleyKleinSphere.cayley_klein_radius()CayleyKleinSphere.generalized_radius()CayleyKleinSphere.absoluteCayleyKleinSphere.ambient_dimensionCayleyKleinSphere.at_infinity()CayleyKleinSphere.dimensionCayleyKleinSphere.embed()CayleyKleinSphere.geometryCayleyKleinSphere.is_circle()CayleyKleinSphere.is_hypersphere()CayleyKleinSphere.quadric()CayleyKleinSphere.unembed()CayleyKleinSphere.centerCayleyKleinSphere.radiusCayleyKleinSphere.subspace
MetricCayleyKleinSphereMetricCayleyKleinSphere.metric_radius()MetricCayleyKleinSphere.absoluteMetricCayleyKleinSphere.ambient_dimensionMetricCayleyKleinSphere.at_infinity()MetricCayleyKleinSphere.cayley_klein_radius()MetricCayleyKleinSphere.dimensionMetricCayleyKleinSphere.embed()MetricCayleyKleinSphere.geometryMetricCayleyKleinSphere.is_circle()MetricCayleyKleinSphere.is_hypersphere()MetricCayleyKleinSphere.quadric()MetricCayleyKleinSphere.unembed()MetricCayleyKleinSphere.centerMetricCayleyKleinSphere.radiusMetricCayleyKleinSphere.subspaceMetricCayleyKleinSphere.generalized_radius()
GeneralizedCayleyKleinSphereGeneralizedCayleyKleinSphere.absoluteGeneralizedCayleyKleinSphere.ambient_dimensionGeneralizedCayleyKleinSphere.at_infinity()GeneralizedCayleyKleinSphere.dimensionGeneralizedCayleyKleinSphere.embed()GeneralizedCayleyKleinSphere.geometryGeneralizedCayleyKleinSphere.is_circle()GeneralizedCayleyKleinSphere.is_hypersphere()GeneralizedCayleyKleinSphere.quadric()GeneralizedCayleyKleinSphere.unembed()GeneralizedCayleyKleinSphere.centerGeneralizedCayleyKleinSphere.radiusGeneralizedCayleyKleinSphere.subspaceGeneralizedCayleyKleinSphere.metric_radius()GeneralizedCayleyKleinSphere.cayley_klein_radius()GeneralizedCayleyKleinSphere.generalized_radius()
- ddg.geometry.spherical_models module
ProjectiveModelProjectiveModel.fixed_pointProjectiveModel.d()ProjectiveModel.absoluteProjectiveModel.ambient_dimensionProjectiveModel.angle()ProjectiveModel.cayley_klein_distance()ProjectiveModel.cayley_klein_sphere()ProjectiveModel.elliptic()ProjectiveModel.elliptic_pointProjectiveModel.elliptic_subspaceProjectiveModel.euclidean()ProjectiveModel.euclidean_pointProjectiveModel.euclidean_subspaceProjectiveModel.from_elliptic()ProjectiveModel.from_euclidean()ProjectiveModel.from_hyperbolic()ProjectiveModel.from_hyperbolic_half_space()ProjectiveModel.from_hyperbolic_poincare()ProjectiveModel.from_lie()ProjectiveModel.from_paraboloid()ProjectiveModel.generalized_cayley_klein_sphere()ProjectiveModel.hyperbolic()ProjectiveModel.hyperbolic_half_space()ProjectiveModel.hyperbolic_poincare()ProjectiveModel.hyperbolic_pointProjectiveModel.hyperbolic_subspaceProjectiveModel.inner_product()ProjectiveModel.lie()ProjectiveModel.paraboloid()ProjectiveModel.pole_of_sphere()ProjectiveModel.sphere_from_pole()ProjectiveModel.to_elliptic()ProjectiveModel.to_euclidean()ProjectiveModel.to_hyperbolic()ProjectiveModel.to_hyperbolic_half_space()ProjectiveModel.to_hyperbolic_poincare()ProjectiveModel.to_lie()ProjectiveModel.to_paraboloid()
Module contents
- ddg.geometry.elliptic
alias of
ProjectiveModel
- ddg.geometry.euclidean
alias of
ProjectiveModel
- ddg.geometry.dual_euclidean
alias of
DualProjectiveModel
- ddg.geometry.hyperbolic
alias of
ProjectiveModel
- ddg.geometry.laguerre
alias of
ProjectiveModel
- ddg.geometry.lie
alias of
ProjectiveModel
- ddg.geometry.moebius
alias of
ProjectiveModel
- ddg.geometry.spherical
alias of
ProjectiveModel
- class ddg.geometry.Pencil(Q1, Q2, **kwargs)[source]
Bases:
LinearTransformablePencil of quadrics in a projective space.
- Parameters:
- Q1, Q2ddg.geometry.Quadric or numpy.ndarray
Quadrics spanning the pencil. If given as arrays, they will be created.
- **kwargsdict
Keyword arguments to be passed to Quadric during creation of Q1 and Q2, if they are given as arrays.
- Raises:
- ValueError
If the geometries of the quadrics don’t match
If the quadrics are not in the same subspace
See also
- Attributes:
- Q1, Q2
- ambient_dimension
- subspace
- property ambient_dimension
- property subspace
- intersection()[source]
Intersection of all quadrics in the pencil
- Returns:
- ddg.geometry.QuadricIntersection
- transform(F)[source]
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- matrix(u)[source]
Return the matrix of a quadric in the pencil.
The pencil is parametrized as:
RP^1 -> pencil, [u1, u2] -> [u1*Q1 + u2*Q2].
We identify [1, a] <-> a and [0, 1] <-> inf.
- Parameters:
- uarray_like (float, float) or float
A finite float will be interpreted as (1, u) and inf will be interpreted as (0, 1). -inf is interpreted as (0, -1).
- Returns:
- numpy.ndarray of shape (n, n)
- quadric(u)[source]
Return a quadric in the pencil. Complex quadrics are not supported.
The pencil is parametrized as:
RP^1 -> pencil, [u1, u2] -> [u1*Q1 + u2*Q2].
We identify [1, a] <-> a and [0, 1] <-> inf.
- Parameters:
- uarray_like (float, float) or float including inf.
A finite float will be interpreted as (1, u) and inf will be interpreted as (0, 1). -inf is interpreted as (0, -1).
- Returns:
- ddg.geometry.Quadric
- roots()[source]
Find values for which quadrics in the pencil are degenerate.
This function calculates the complex roots of the polynomial
P := det(Q1 + lambda * Q2)and their multiplicity. If the sum of the multiplicities less thanN := subspace.dimension + 1,which means thatQ2is degenerate,complex('inf')is added and assigned the “remaining” multiplicityN - deg(P).- Returns:
- dict {complex: int}
Dictionary whose keys are the roots as complex numbers (including infinity) and whose values are their multiplicity.
- degenerate_quadrics()[source]
Calculate real degenerate quadrics in the pencil.
- Returns:
- list of ddg.geometry.Quadric
- regular_matrix()[source]
Calculates a regular quadric Q2
This is achieved by choosing a lambda for
lambda Q2 + Q1such that:det(lambda Q2 +Q1) != 0
Together with
Q1, the newQ2spans the same pencil as the originalQ1, Q2.- Returns:
- ddg.geometry.Quadric
- Raises:
- NotImplementedError
if the pencil is degenerate and only has roots at infinity
- signature_sequence()[source]
Calculates the signature sequence for the pencil described by
lmda*Q2+Q1Uses a representation via
Q1andQ2of the pencil withQ2invertible- Returns:
- ddg.geometry.signatures.SignatureSequence
- eigenvalue_curve_function()[source]
Calculates the eigenvalue curve function
The eigenvalue curve function of a pencil represented by
lambda Q2 + Q1is defined byf(u, lambda) = det(lmda*Q2+Q1-uI), whereIis the identity matrix andu, lambdaare inRP¹.This is needed for special cases in the classification of pencils by signature sequence.
- Returns:
- function calculating the eigenvalue curve
- classification()[source]
Classifies the quadric intersection curve of the pencil via the type of signature sequence
- Returns:
- list
first entry: str (case number)
second entry: str (explanation of cases)
- index_sequence()[source]
Determines the index sequence of a pencil
Derived from the classification of the pencil via signature sequence
- Returns:
- ddg.geometry.signatures.IndexSequence
in normal form
- segre_symbol()[source]
Determines the segre symbol of a pencil
Derived from the classification of the pencil via signature sequence
- Returns:
- ddg.geometry.signatures.SegreSymbol
in normal form
- change_affine_picture(before, after=-1)
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)
- class ddg.geometry.Quadric(matrix, subspace=None, atol=None, rtol=None)[source]
Bases:
Embeddable,LinearTransformableQuadric in real projective space.
Let
qbe a quadratic form on R^(n+1). The quadric corresponding toqis the set{ [x] in RP^n : q(x) = 0 }.- Parameters:
- matrixnumpy.ndarray of shape (n, n)
Symmetric matrix representing the quadratic form in homogeneous coordinates.
The matrix is interpreted as the Gram matrix with respect to the given basis of
subspace.Non-float dtypes will be converted to float.
- subspaceddg.geometry.Subspace or iterable of numpy.ndarray (default=None)
Subspace containing the quadric. Can be given as a list of homogeneous coordinate vectors.
If None is given, uses whole space with standard basis.
- atol, rtolfloat (default=None)
Tolerances that will be used internally by the class. If these are set to None, the global defaults will be used.
- Raises:
- ValueError
If
matrixis not symmetricIf the dimension of the subspace does not match the shape of
matrix.
Notes
This class supports the following operators:
==, meaning equality of the quadratic forms.<=, meaning that one quadratic form is a restriction of the other.in, meaning set membership.
- Attributes:
- matrixnumpy.ndarray of shape (n, n)
- subspaceddg.geometry.Subspace
- ambient_dimension
dimensionThe (real) dimension of the quadric.
dimension_complexComplex dimension of the quadric.
rankRank of self.matrix.
corankCorank of self.matrix.
is_degenerateWhether the quadric is degenerate.
singular_subspaceSingular subspace.
non_degenerate_subspaceNon-degenerate subspace.
- atol, rtol
- property ambient_dimension
- property dimension
The (real) dimension of the quadric.
More precisely, the maximum of the dimensions of the manifolds contained in the set of real points in the quadric.
Ignores affine coordinates! I.e. we don’t distinguish between the quadric lying at infinity or not.
- Returns:
- int
Notes
This function was fully intuited. There is no guarantee that this gives correct results.
- property dimension_complex
Complex dimension of the quadric.
This is the same as the real dimension, except that the positive definite quadric is not empty and not a special case anymore. In fact, there is only one non-degenerate quadric up to projective transformation, the one with diagonal
[1,...,1].- Returns:
- int
- embed(subspace=None)[source]
The embedded object.
We can embed a subset X of n-dimensional projective space into m-dimensional space (where m >= n) by choosing an n-dimensional subspace S in RP^m together with a basis B. We then interpret the original homogeneous coordinates as coordinates w.r.t. this basis B.
More concretely: If M is the
matrixof S, we defineX.embed(S) := { [M @ x] | [x] in X }.X.embed(S)must be the same kind of object as X, for example if X is a euclidean sphere, the basis M must be chosen so thatX.embed(S)is also a euclidean sphere.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
Subspace in m-dimensional ambient space whose dimension is the ambient dimension of
self(where m >= n). The homogeneous coordinates of points are used as cordinates w.r.t. the given basis ofsubspace.The default is the coordinate hyperplane {x_n+1 = 0} in (n+1)-dimensional space, where n is the ambient dimension of
self. The basis is the standard basis with the second to last basis vector missing.
- Returns:
- type(self)
Object in m-dimensional ambient space contained in
subspace.
- Raises:
- ValueError
If embedding w.r.t. the given basis would result in an object of a different type.
- unembed(subspace=None)[source]
Inverse of
embed.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
k-dim. subspace to treat as the new ambient space. coordinates of points will be computed w.r.t. the given basis of
subspace.The default is the coordinate hyperplane {x_n = 0} which will fail if the object is not contained in this subspace.
- Returns:
- type(self)
Object in
k-dim. ambient space.
- Raises:
- ValueError
If object is not contained in
subspace.If coordinate computation would result in an object of a different type.
- inner_product(v, w)[source]
Inner product defined by / defining the quadric.
- Parameters:
- v, wnumpy.ndarray of shape (ambient_dimension + 1,)
Two vectors that lie in the containing subspace.
- Returns:
- float
a.T @ matrix @ b, whereaandbare the coordinates ofvandwin terms of the given basis of the containing subspace.
- cayley_klein_distance(v, w)[source]
Cayley-Klein “distance”.
This is defined as
b(v, w) ** 2 / (b(v, v) * b(w, w))
Where b is the inner product induced by the absolute. None of the points can lie on the absolute.
- Parameters:
- v, wnumpy.ndarray or ddg.geometry.Point
Homogeneous coordinate vectors or Point instances
- Returns:
- float
- Raises:
- ValueError
If either of the points is contained in the absolute quadric.
- conjugate(S1, S2)[source]
Conjugacy of two subspaces.
Whether two subspaces are conjugate, i.e. if approximately
inner_product(v, w) == 0for all [v] in S1 and [w] in S2.- Parameters:
- S1, S2ddg.geometry.Subspace or numpy.ndarray
Subspaces contained in self.subspace. Arrays will be interpreted as matrices whose columns are points in homogeneous coordinates. In particular, 1D arrays are simply points in homogeneous coordinates.
- Returns:
- bool
- signature(subspace=None, affine=False)[source]
Alias for
signature().
- normalize(affine=False)[source]
Return an equal quadric expressed in coordinates that normalize it.
Returns an equal quadric Q_normalized such that
Q_normalized.matrix == sgn.matrix
where sgn = self.signature(affine). See
ddg.geometry.signatures.Signatureandddg.geometry.signatures.AffineSignaturefor more information.If
affine=True,Q_normalized.subspace.pointswill be in the form [d1,…,dn, p], where n is the dimension of the subspace, d1,…,dn are directions at infinity and p is a point in the subspace not at infinity.- Parameters:
- affinebool (default=False)
- Returns:
- Q_normalizedddg.geometry.Quadric
- property rank
Rank of self.matrix.
- Returns:
- int
- property corank
Corank of self.matrix.
- Returns:
- int
- property singular_subspace
Singular subspace.
Subspace containing all singular points of the quadric (points in the kernel of
self.matrix).- Returns:
- ddg.geometry.Subspace of dimension
corank - 1and the - same ambient dimension as the quadric.
- ddg.geometry.Subspace of dimension
- property non_degenerate_subspace
Non-degenerate subspace.
Complementary subspace of the kernel of
self.matrix.- Returns:
- ddg.geometry.Subspace
Has dimension
rank - 1and the same ambient dimension as the quadric.
- property is_degenerate
Whether the quadric is degenerate.
- Returns:
- bool
- dual_transformation(F)[source]
Dualizes a transformation of the ambient space.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension+1, ambient_dimension+1)
An invertible matrix.
- Returns:
- F_dualnumpy.ndarray of shape (ambient_dimension+1,ambient_dimension+1)
This is an invertible matrix that approximately satisfies
F_dual @ B_dual == F @ B @ np.linalg.inv((F @ B).T @ (F @ B)), whereB_dualis the subspace of the dual quadric. That is, it maps the old dual basis to the new one.
- transform(F)[source]
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- change_affine_picture(before, after=-1)
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)
- class ddg.geometry.QuadricIntersection(Q1, Q2)[source]
Bases:
Embeddable,LinearTransformableIntersection of two quadrics.
- Parameters:
- Q1, Q2ddg.geometry.Quadric
Quadrics that define the intersection
- Raises:
- ValueError
If the objects handed are not two Quadrics
If the geometries of the quadrics don’t match
If the quadrics are not in the same subspace
- Attributes:
- Q1, Q2ddg.geometry.Quadric
- dimension
- dimension_complex
- ambient_dimension
- property ambient_dimension
- property dimension
- property dimension_complex
- pencil()[source]
Pencil whose intersection curve is represented and that the two matrices span
- Returns:
- ddg.geometry.Pencil
- transform(F)[source]
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- embed(subspace=None)[source]
The embedded object.
We can embed a subset X of n-dimensional projective space into m-dimensional space (where m >= n) by choosing an n-dimensional subspace S in RP^m together with a basis B. We then interpret the original homogeneous coordinates as coordinates w.r.t. this basis B.
More concretely: If M is the
matrixof S, we defineX.embed(S) := { [M @ x] | [x] in X }.X.embed(S)must be the same kind of object as X, for example if X is a euclidean sphere, the basis M must be chosen so thatX.embed(S)is also a euclidean sphere.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
Subspace in m-dimensional ambient space whose dimension is the ambient dimension of
self(where m >= n). The homogeneous coordinates of points are used as cordinates w.r.t. the given basis ofsubspace.The default is the coordinate hyperplane {x_n+1 = 0} in (n+1)-dimensional space, where n is the ambient dimension of
self. The basis is the standard basis with the second to last basis vector missing.
- Returns:
- type(self)
Object in m-dimensional ambient space contained in
subspace.
- Raises:
- ValueError
If embedding w.r.t. the given basis would result in an object of a different type.
- unembed(subspace=None)[source]
Inverse of
embed.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
k-dim. subspace to treat as the new ambient space. coordinates of points will be computed w.r.t. the given basis of
subspace.The default is the coordinate hyperplane {x_n = 0} which will fail if the object is not contained in this subspace.
- Returns:
- type(self)
Object in
k-dim. ambient space.
- Raises:
- ValueError
If object is not contained in
subspace.If coordinate computation would result in an object of a different type.
- change_affine_picture(before, after=-1)
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)
- ddg.geometry.cayley_klein_sphere(center, radius, absolute)[source]
Create a Cayley-Klein sphere from center, radius and absolute.
Let b be the inner product induced by the
absolute. A Cayley-Klein sphere is defined as the solution set of:b(center, x) ** 2 - radius * b(center, center) * b(x, x) = 0
Note that if
centerlies on theabsolute, you will just get the polar hyperplane ofcenter.- Parameters:
- centerddg.geometry.Point
- radiusfloat
- absoluteddg.geometry.Quadric
- Returns:
- ddg.geometry.Quadric
- Raises:
- ValueError
If
centeris not inabsolute.subspace.
- ddg.geometry.cone_axis(cone)[source]
Find the axis of a non-parabolic cone.
More precisely: The axis of a non-parabolic quadric with signature (n-1, 1, 1), where n is the dimension of the containing subspace.
- Parameters:
- coneddg.geometry.Quadric
- Returns:
- ddg.geometry.Subspace
- Raises:
- ValueError
If Quadric does not have the signature mentioned above.
- ddg.geometry.generalized_cayley_klein_sphere(center, radius, absolute)[source]
Create Generalized Cayley-Klein sphere from center, “radius” and absolute.
Let b be the inner product induced by the
absolute. A Cayley-Klein sphere is defined as the solution set of:b(center, x) ** 2 - radius * b(x, x) = 0
This allows centers to lie on the absolute quadric, at the expense of depending on the representative vector of
center. The equation of a regular Cayley-Klein sphere can still be obtained by using the new radiusradius * b(center, center).- Parameters:
- centerddg.geometry.Point
- radiusfloat
- absoluteddg.geometry.Quadric
- Returns:
- ddg.geometry.Quadric
- Raises:
- ValueError
If
centeris not inabsolute.subspace.
- ddg.geometry.intersect_quadrics(Q1, Q2)[source]
Creates an object representing the intersection curve of two quadrics for visualisation purposes
- Parameters:
- Q1, Q2: ddg.geometry.Quadric
Two quadrics that span a pencil whose intersection curve is represented
- Returns:
- ddg.geometry.QuadricIntersection
- ddg.geometry.intersect_quadrics_with_diagonalisable_matrices(quadric1, quadric2, affine=False, atol=1e-09, rtol=0.0)[source]
Intersection curve of certain quadrics.
Currently only works for two quadrics that are both contained in a pencil
u1 * diag([1, 1, 0, -1]) + u2 * diag([0, k**2, 1, -1]) \_______ ________/ \_______ ________/ \/ \/ D1 D2for some k in [-1, 1]. The quadrics can be contained in any 3D subspace as long as they are given w.r.t. the same basis. The function checks if both quadrics are contained in a pencil like this.
If you know your two quadrics with matrices Q1, Q2 are contained in a transformed version of such a pencil, i.e.
u1 * F.T @ D1 @ F + u2 * F.T @ D2 @ F
for some known invertible F, you can make it work as well: Let B be quadric1.subspace.matrix. Then the quadrics
Quadric(inv(F.T) @ Q1 @ inv(F), subspace=(B @ inv(F)).T) Quadric(inv(F.T) @ Q1 @ inv(F), subspace=(B @ inv(F)).T)
can be intersected with this function. Automatic detection of this is not yet implemented.
- Parameters:
- quadric1, quadric2ddg.geometry.Quadric
- affinebool (default=False)
Whether the resulting curve should output affine or homogeneous coordinates.
- atolfloat (default=1e-9)
- rtolfloat (default=0.0)
This function uses the global tolerance defaults if
atolorrtolare set to None. Seeddg.nonexactfor details.
- Returns:
- NetCollection
- Raises:
- ValueError
If the two quadrics are given in different coordinate systems.
If quadric1 and quadric2 do not span the above-mentioned pencil.
Notes
For visualization purposes, not all subspace bases work well, because the curve might pass through infinity.
- ddg.geometry.polarize(object_, quadric)[source]
Polarize a geometric object with respect to a quadric.
- Parameters:
- object_Geometric object
Currently supported: ddg.geometry.Subspace, Quadric.
- quadricddg.geometry.Quadric
- Returns:
- polartype depending on the input type
Polar object
- Raises:
- TypeError
If the type of object is not supported.
See also
polarize_oriented
Notes
This function will not ensure any orientation of the resulting polar.
- ddg.geometry.quadric_from_points(points)[source]
Returns a quadric from homogeneous coordinates of a set of points.
There is always a quadric going through (n^2 + 3n)/2 points in n-dimensional projective space, e.g. nine points determine a quadric in 3d projective space.
- Parameters:
- pointsiterable of ddg.geometry.Point
- Returns:
- ddg.geometry.Quadric
- Raises:
- ValueError
If the number of points does not match the dimension as stated above.
- ValueError
If the given points do not determine a unique quadric.
- ddg.geometry.quadric_from_three_skew_lines(lines)[source]
Returns a quadric in from three skew lines in 3-dimensional projective space.
Given three skew lines in 3-dimensional projective space, the family of lines that meet all three lines sweeps out a unique quadric.
- Parameters:
- linesiterable of ddg.geometry.Subspace
Three skew lines in 3-dimensional projective space.
- Returns:
- ddg.geometry.Quadric
- Raises:
- ValueError
If length of
linesiterable is not exactly three.
Notes
Skew lines are lines in 3-dimensional projective space that are neither parallel nor intersecting.
- ddg.geometry.quadric_normalization(quadric, affine=False)[source]
Signature and normalizing transformation.
Approximately satisfies:
F.T @ quadric.matrix @ F == sgn.matrix
See
ddg.geometry.signatures.Signatureandddg.geometry.signatures.AffineSignaturefor more information.Note that this is a transformation within the subspace as opposed to a transformation of the ambient space and thus cannot be used with
quadric.transform.- Parameters:
- quadricddg.geometry.Quadric
- affinebool (default=False)
Whether to normalize to projective or affine normal form.
- Returns:
- sgnSignature or AffineSignature
- Fnumpy.ndarray of shape (ambient_dimension+1, dimension+2)
Transformation that normalizes the quadric
- ddg.geometry.signature(quadric, subspace=None, affine=False)[source]
Signature of a quadric, optionally restricted to a subspace.
- Parameters:
- subspaceddg.geometry.Subspace or None (default=None)
Subspace contained in self.subspace
- affinebool (default=False)
Whether to return projective or affine signature
- Returns:
- Signature or AffineSignature
- Raises:
- ValueError
If subspace is not contained in self.subspace.
- ddg.geometry.touching_cone(p, quadric, in_subspace=False)[source]
Calculate touching cone.
The touching cone of a quadric Q and a point P is the set of lines through P that are tangent to Q.
Note that by default, this function looks at tangency in the ambient space as opposed to within
quadric.subspace. This means that if the quadric is contained in a proper subspace, the function returns the join ofpandquadric.- Parameters:
- pnumpy.ndarray of shape (quadric.ambient_dimension+1,) or ddg.geometry.Point
Point in homogeneous coordinates. Must lie in
quadric.subspaceif in_subspace is True.- quadricddg.geometry.Quadric
- in_subspacebool (default=False)
- Returns:
- ddg.geometry.Quadric or ddg.geometry.Subspace
- Raises:
- ValueError
If
in_subspaceis True andpis not contained inquadric.subspace.
- class ddg.geometry.Point(point, atol=None, rtol=None)[source]
Bases:
SubspaceSubclass for points (0-dim. projective subspaces).
- Parameters:
- pointlist or numpy.ndarray of shape (n,)
- atol, rtolfloat (default=None)
Tolerances that will be used internally by the class. If these are set to None, the global defaults will be used.
See also
- Attributes:
pointHomogeneous coordinate vector representing the point.
affine_pointAffine coordinate vector representing the point.
- property point
Homogeneous coordinate vector representing the point.
- Returns:
- numpy.ndarray (dimension+1,)
- property affine_point
Affine coordinate vector representing the point.
- Returns:
- numpy.ndarray of shape (dimension,)
- Raises:
- ValueError
If the point is at infinity.
- property affine_matrix
Matrix whose columns span the affine part of the subspace.
Computes points in affine coordinates that, when homogenized, form a basis for the subspace. Returns them as the columns of a matrix.
- Returns:
- numpy.ndarray of shape (ambient_dimension, dimension+1)
- Raises:
- ValueError
If the subspace is at infinity.
- property affine_point_and_directions
Return point in the subspace and directions.
Returns affine coordinate vectors p and d1, …, dk such that the original subspace is spanned by [p,1], [d1,0], …, [dk,0].
The point is the one that is closest to the zero vector in affine coordinates and the directions are orthonormal.
- Returns:
- numpy.ndarray, list of numpy.ndarray
- property affine_points
List of points spanning the affine part of the subspace.
Computes points in affine coordinates that, when homogenized, form a basis for the subspace.
- Returns:
- list of numpy.ndarray of shape (ambient_dimension,)
- property ambient_dimension
- at_infinity()
Whether the object is contained in the hyperplane at infinity.
- Returns:
- bool
- center(center, remove_index=None, insert_index=0)
Returns subspace with a point inserted into the basis. Useful for visualization.
See
center_subspace()for full documentation.See also
ddg.geometry.center_subspaceEquivalent function
- change_affine_picture(before, after=-1)
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)
- property codimension
- dehomogenize()
Returns subspace with last entries of basis vectors normalized to 1. Useful for visualization.
See
dehomogenize_subspace()for full documentation.See also
ddg.geometry.dehomogenize_subspaceEquivalent function
- property dimension
- dual(ambient_space=None)
Return dual subspace.
- Parameters:
- ambient_spaceddg.geometry.Subspace (default=None)
Other subspace containing this subspace that should be used as ambient space when dualizing. None means whole space.
- Returns:
- ddg.geometry.Subspace
- dual_oriented(ambient_space=None)
Return oriented dual subspace.
- Parameters:
- ambient_spaceddg.geometry.Subspace (default=None)
Other subspace containing this subspace that should be used as ambient space when dualizing. None means whole space.
- Returns:
- ddg.geometry.Subspace
- embed(subspace=None)
The embedded object.
We can embed a subset X of n-dimensional projective space into m-dimensional space (where m >= n) by choosing an n-dimensional subspace S in RP^m together with a basis B. We then interpret the original homogeneous coordinates as coordinates w.r.t. this basis B.
More concretely: If M is the
matrixof S, we defineX.embed(S) := { [M @ x] | [x] in X }.X.embed(S)must be the same kind of object as X, for example if X is a euclidean sphere, the basis M must be chosen so thatX.embed(S)is also a euclidean sphere.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
Subspace in m-dimensional ambient space whose dimension is the ambient dimension of
self(where m >= n). The homogeneous coordinates of points are used as cordinates w.r.t. the given basis ofsubspace.The default is the coordinate hyperplane {x_n+1 = 0} in (n+1)-dimensional space, where n is the ambient dimension of
self. The basis is the standard basis with the second to last basis vector missing.
- Returns:
- type(self)
Object in m-dimensional ambient space contained in
subspace.
- Raises:
- ValueError
If embedding w.r.t. the given basis would result in an object of a different type.
- orthonormalize()
Returns subspace with a regularized basis. Useful for visualization.
See
orthonormalize_subspace()for full documentation.See also
ddg.geometry.orthonormalize_subspaceEquivalent function
- orthonormalize_and_center(center)
Returns subspace with a regularized basis and a point inserted in the basis Useful for visualization.
See
orthonormalize_and_center_subspace()for full documentation.See also
ddg.geometry.orthonormalize_and_center_subspaceEquivalent function
- property points
List of points spanning the subspace in homogeneous coordinates.
- Returns:
- list of numpy.ndarray of shape (ambient_dimension+1,)
- transform(F)
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- unembed(subspace=None)
Inverse of
embed.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
k-dim. subspace to treat as the new ambient space. coordinates of points will be computed w.r.t. the given basis of
subspace.The default is the coordinate hyperplane {x_n = 0} which will fail if the object is not contained in this subspace.
- Returns:
- type(self)
Object in
k-dim. ambient space.
- Raises:
- ValueError
If object is not contained in
subspace.If coordinate computation would result in an object of a different type.
- class ddg.geometry.Subspace(*points, atol=None, rtol=None)[source]
Bases:
Embeddable,LinearTransformableSubspace of a projective space. Represented by a number of vectors in homogeneous coordinates.
- Parameters:
- *pointsarray_like of list or numpy.ndarray of shape (n,)
Homogeneous coordinate vectors spanning the subspace. If the span is 1-dimensional, automatically casts to _subspaces.Point
Non-float dtypes will be converted to float.
- atol, rtolfloat (default=None)
Tolerances that will be used internally by the class. If these are set to None, the global defaults will be used.
See also
Notes
Subspaces can be empty. In this case, points are stored as an empty matrix with shape (n,0) if the ambient dimension is n-1. Empty spaces must be initialized with 0-vectors.
- Attributes:
pointsList of points spanning the subspace in homogeneous coordinates.
- matrix
affine_pointsList of points spanning the affine part of the subspace.
affine_matrixMatrix whose columns span the affine part of the subspace.
affine_point_and_directionsReturn point in the subspace and directions.
- dimension
- ambient_dimension
- codimension
Methods
Whether the object is contained in the hyperplane at infinity.
- property points
List of points spanning the subspace in homogeneous coordinates.
- Returns:
- list of numpy.ndarray of shape (ambient_dimension+1,)
- embed(subspace=None)[source]
The embedded object.
We can embed a subset X of n-dimensional projective space into m-dimensional space (where m >= n) by choosing an n-dimensional subspace S in RP^m together with a basis B. We then interpret the original homogeneous coordinates as coordinates w.r.t. this basis B.
More concretely: If M is the
matrixof S, we defineX.embed(S) := { [M @ x] | [x] in X }.X.embed(S)must be the same kind of object as X, for example if X is a euclidean sphere, the basis M must be chosen so thatX.embed(S)is also a euclidean sphere.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
Subspace in m-dimensional ambient space whose dimension is the ambient dimension of
self(where m >= n). The homogeneous coordinates of points are used as cordinates w.r.t. the given basis ofsubspace.The default is the coordinate hyperplane {x_n+1 = 0} in (n+1)-dimensional space, where n is the ambient dimension of
self. The basis is the standard basis with the second to last basis vector missing.
- Returns:
- type(self)
Object in m-dimensional ambient space contained in
subspace.
- Raises:
- ValueError
If embedding w.r.t. the given basis would result in an object of a different type.
- unembed(subspace=None)[source]
Inverse of
embed.- Parameters:
- subspaceddg.geometry.Subspace (default=None)
k-dim. subspace to treat as the new ambient space. coordinates of points will be computed w.r.t. the given basis of
subspace.The default is the coordinate hyperplane {x_n = 0} which will fail if the object is not contained in this subspace.
- Returns:
- type(self)
Object in
k-dim. ambient space.
- Raises:
- ValueError
If object is not contained in
subspace.If coordinate computation would result in an object of a different type.
- property affine_points
List of points spanning the affine part of the subspace.
Computes points in affine coordinates that, when homogenized, form a basis for the subspace.
- Returns:
- list of numpy.ndarray of shape (ambient_dimension,)
- property affine_matrix
Matrix whose columns span the affine part of the subspace.
Computes points in affine coordinates that, when homogenized, form a basis for the subspace. Returns them as the columns of a matrix.
- Returns:
- numpy.ndarray of shape (ambient_dimension, dimension+1)
- Raises:
- ValueError
If the subspace is at infinity.
- property affine_point_and_directions
Return point in the subspace and directions.
Returns affine coordinate vectors p and d1, …, dk such that the original subspace is spanned by [p,1], [d1,0], …, [dk,0].
The point is the one that is closest to the zero vector in affine coordinates and the directions are orthonormal.
- Returns:
- numpy.ndarray, list of numpy.ndarray
- property dimension
- property ambient_dimension
- property codimension
- transform(F)[source]
Return a linearly transformed copy.
The transformation is assumed to be a projective transformation in homogeneous coordinates.
- Parameters:
- Fnumpy.ndarray of shape (ambient_dimension + 1, ambient_dimension + 1)
- Returns:
- type(self)
- dual(ambient_space=None)[source]
Return dual subspace.
- Parameters:
- ambient_spaceddg.geometry.Subspace (default=None)
Other subspace containing this subspace that should be used as ambient space when dualizing. None means whole space.
- Returns:
- ddg.geometry.Subspace
- dual_oriented(ambient_space=None)[source]
Return oriented dual subspace.
- Parameters:
- ambient_spaceddg.geometry.Subspace (default=None)
Other subspace containing this subspace that should be used as ambient space when dualizing. None means whole space.
- Returns:
- ddg.geometry.Subspace
- orthonormalize()[source]
Returns subspace with a regularized basis. Useful for visualization.
See
orthonormalize_subspace()for full documentation.See also
ddg.geometry.orthonormalize_subspaceEquivalent function
- center(center, remove_index=None, insert_index=0)[source]
Returns subspace with a point inserted into the basis. Useful for visualization.
See
center_subspace()for full documentation.See also
ddg.geometry.center_subspaceEquivalent function
- orthonormalize_and_center(center)[source]
Returns subspace with a regularized basis and a point inserted in the basis Useful for visualization.
See
orthonormalize_and_center_subspace()for full documentation.See also
ddg.geometry.orthonormalize_and_center_subspaceEquivalent function
- dehomogenize()[source]
Returns subspace with last entries of basis vectors normalized to 1. Useful for visualization.
See
dehomogenize_subspace()for full documentation.See also
ddg.geometry.dehomogenize_subspaceEquivalent function
- change_affine_picture(before, after=-1)
Transform the object to a different affine view.
Dehomogenizing the object post-transform with affine component
afterwill produce the same affine picture as dehomogenizing the object pre-transform with affine componentbefore.The actual transformation that achieves this just permutes the homogeneous coordinates as follows: It deletes the entry at
beforeand inserts it again at positionafter.Here are two examples of how you might use this function:
You defined a projective object
Xwith a certain affine picture in mind and you followed our convention of using affine component -1. You now want to see what it would look like when dehomogenized using a different affine componenti. To do this, you would just doX_ = X.change_affine_picture(i)and then visualize the object normally.You don’t like our convention of dehomogenizing by the last component and want to define your object
Xwith the affine picture with respect to affine componentiin mind. To visualize your object as you imagine it, you would also doX_ = X.change_affine_picture(i).
- Parameters:
- beforeint
- afterint (default=-1)
- Returns:
- type(self)
- ddg.geometry.center_subspace(subspace, center, remove_index=None, insert_index=0)[source]
Insert a specific point into the basis of a subspace.
This is especially useful in preparation for visualization: When applying this function and then using the “convex” parametrization in
to_smooth_net, the parametrization will be centered around the newcenter, if it is a point not at infinity.- Parameters:
- subspaceddg.geometry.Subspace
- centerddg.geometry.Point or numpy.ndarray of shape (k,) or (k+1,)
Where
kis the ambient dimension of the subspace. Point must lie in subspace. Can be given as Point object or as array containing affine or homogeneous coordinates.- remove_indexint (default=None)
Index of basis vector that should be replaced with
center. If None, we search for one.- insert_indexint (default=0)
Index where center should be inserted.
- Returns:
- ddg.geometry.Subspace
The same subspace with a basis that has
centerat positioninsert_index.
- Raises:
- ValueError
If center does not lie in the subspace.
If the vector at
remove_indexcould not be replaced withcenterwhile still having a basis.
- ddg.geometry.coordinate_hyperplane(n, zero_component=-1, origin_index=-1)[source]
“Equatorial plane” in n-dimensional space.
Returns the coordinate hyperplane {x_i = 0}, where
i=zero_component.- Parameters:
- nint
Ambient dimension
- zero_componentint (default=-1)
Which component should be 0 in this hyperplane in affine coordinates.
- origin_indexint (default=-1)
Where to insert the “origin” (the point not at infinity)
- Returns:
- ddg.geometry.Subspace
- ddg.geometry.dehomogenize_subspace(subspace)[source]
Normalize last entries of basis vectors not at infinity to 1.
- Parameters:
- subspaceddg.geometry.Subspace
- Returns:
- ddg.geometry.Subspace
The same subspace with normalized basis vectors.
- ddg.geometry.hyperplane_from_normal(normal, level=None, point=None, **kwargs)[source]
An affine hyperplane defined by either <x, normal> == level, or the normal and a point (given in affine coordinates) on the plane.
- ddg.geometry.least_square_subspace(points, k)[source]
Computes the k-dimensional subspace closest to the affine coordinates of N points.
- Parameters:
- pointssequence of ddg.geometry.Point
Points containing homogeneous coordinates.
- kint
Dimension of the subspace.
- Returns:
- subspaceddg.geometry.Subspace
k-dimensional projective subspace.
- ddg.geometry.least_square_subspace_from_affine_points(points, k)[source]
Computes the k-dimensional subspace closest to N affine points. See below for more details.
- Parameters:
- pointssequence of numpy.ndarray, each of shape (n,)
Affine coordinates of N points.
- kint
Dimension of the subspace.
- Returns:
- subspaceddg.geometry.Subspace
k-dimensional projective subspace.
- Raises:
- ValueError
If k is strictly greater than the ambient projective dimension n.
See also
Notes
The returned subspace is best-fitting k-dimensional subspace to the N given points in the sense that it minimizes the sum of the squares of the Euclidean distances of the points to it.
- ddg.geometry.level(hyperplane)[source]
Level l of a hyperplane.
The hyperplane consists of all points
xsuch that<x, N> = l
where
Nis the unit normal of the hyperplane.The level is the distance of the hyperplane from the origin in the normal direction, i.e. the hyperplane contains l * N.
- Parameters:
- hyperplaneddg.geometry.Subspace
Hyperplane in n-dimensional ambient space.
- Returns:
- lfloat
- ddg.geometry.normal(hyperplane)[source]
Unit normal vector N of a hyperplane.
The hyperplane consists of all points
xsuch that<x, N> = l
where
lis the level of the hyperplane.- Parameters:
- hyperplaneddg.geometry.Subspace
Hyperplane in n-dimensional ambient space.
- Returns:
- Nnumpy.ndarray of shape (n,)
- ddg.geometry.normal_with_level(hyperplane)[source]
Unit normal vector and negative level of a hyperplane in one vector.
A hyperplane having normal
Nand levellmeans that in affine coordinates, the hyperplane is the set of pointsxsuch that<x, N> = l,
which is equivalent to
<x, N> - l = 0.
This function computes a representative vector
v = [N, -l]of the dual space, normalized such thatNhas unit length.-Nand-ldefine the same hyperplane. To fix this sign, an orientation would have to be given on the hyperplane. This function does not distinguish between the two choices, so the sign should be treated as random.- Parameters:
- hyperplaneddg.geometry.Subspace
Hyperplane in n-dimensional ambient space.
- Returns:
- Nlnumpy.ndarray of shape (n+1,)
The vector
[N, -l]. The subspacePoint(Nl).dual()is the original hyperplane.
- ddg.geometry.normals(subspace)[source]
Return all normal directions of a subspace.
If p1, p2 are two points in the subspace in affine coordinates and n is a normal direction, then
<p1 - p2, n> = 0.
- Parameters:
- subspaceddg.geometry.Subspace
- Returns:
- list of numpy.ndarray of shape (subspace.ambient_dimension,)
Normals in affine coordinates.
- ddg.geometry.orthonormalize_and_center_subspace(subspace, center)[source]
Regularize the basis of a subspace. Useful for visualization.
Returns an equal subspace with a basis of the form
[p, v1,...,vk], wherepis the center with last entry 1 andv1,...,vkare orthonormal direction vectors at infinity. This is only possible if the subspace is not at infinity.When using the “convex” parametrization in to_smooth_net, the parametrization of the subspace with this new basis will be
f(x1,...,xk) = p + x1 * v1 + ... + xk * vk
- Parameters:
- subspaceddg.geometry.Subspace
- centerddg.geometry.Point or numpy.ndarray of shape (k,) or (k+1,)
Where
kis the ambient dimension of the subspace. Point must lie in subspace. Can be given as Point object or as array containing affine or homogeneous coordinates.
- Returns:
- ddg.geometry.Subspace
The same subspace with the regularized basis.
- Raises:
- ValueError
If center does not lie in the subspace.
If subspace is at infinity.
- ddg.geometry.orthonormalize_subspace(subspace)[source]
Regularize the basis of a subspace. Useful for visualization.
Returns an equal subspace with a basis of the form
[p, v1,...,vk], wherepis the point in the subspace closest to the origin with last entry 1 andv1,...,vkare orthonormal direction vectors at infinity. This is only possible if the subspace is not at infinity.When using the “convex” parametrization in to_smooth_net, the parametrization of the subspace with this new basis will be
f(x1,...,xk) = p + x1 * v1 + ... + xk * vk
- Parameters:
- subspaceddg.geometry.Subspace
- Returns:
- ddg.geometry.Subspace
The same subspace with the regularized basis.
- Raises:
- ValueError
If subspace is at infinity.
- ddg.geometry.random_contained_subspace(subspace, dimension=None, seed=None)[source]
Create a random subspace contained in another subspace.
- Parameters:
- subspaceddg.geometry.Subspace
The subspace that should contain the resulting subspace.
- dimensionint (default=None)
Dimension of the resulting subspace. If None, this is chosen randomly between 0 and
subspace.dimension(inclusive).- seedint, numpy.random.Generator or None (default=None)
Passes a fixed seed to default Generator class. If passed a Generator, just uses that generator for random generation.
- Returns:
- ddg.geometry.Subspace
- Raises:
- ValueError
If dimension is greater than
subspace.dimension.
- ddg.geometry.random_subspace(ambient_dimension, subspace_dimension=None, seed=None)[source]
Create a random subspace.
- Parameters:
- ambient_dimensionint
- subspace_dimensionint (default=None)
Dimension of the resulting subspace. If None, this is chosen randomly between 0 and ambient_dimension (inclusive).
- seedint, numpy.random.Generator or None (default=None)
Passes a fixed seed to default Generator class. If passed a Generator, just uses that generator for random generation.
- Returns:
- ddg.geometry.Subspace
- ddg.geometry.subspace_from_affine_columns(matrix, **kwargs)[source]
Create a subspace from the columns of a matrix, interpreted as affine coordinates.
- Parameters:
- matrixnumpy.ndarray
Array whichs columns describe the affine points
- **kwargsdict
Other keyword arguments to be passed to the subspace.
- Returns:
- ddg.geometry.Subspace
Subspace spanned by the given points
- ddg.geometry.subspace_from_affine_points(*points, **kwargs)[source]
Create a subspace from affine points.
- Parameters:
- *pointsiterable of numpy.ndarray or list
Affine coordinate vectors
- **kwargsdict
Other keyword arguments to be passed to the subspace.
- Returns:
- ddg.geometry.Subspace
Subspace spanned by the given points
- ddg.geometry.subspace_from_affine_points_and_directions(points, directions, **kwargs)[source]
Create a subspace from affine points and directions.
- Parameters:
- points(list of numpy.array) or numpy.array
List of points or a single point
- directions(list of numpy.array) or numpy.array
List of directions or a single direction
- **kwargsdict
Other keyword arguments to be passed to the subspace.
- Returns:
- ddg.geometry.Subspace
Subspace spanned by the given points and directions
- Raises:
- ValueError
If both points and directions are empty lists.
- ddg.geometry.subspace_from_affine_rows(matrix, **kwargs)[source]
Create a subspace from the rows of a matrix, interpreted as affine coordinates.
- Parameters:
- matrixnumpy.ndarray
Array whichs columns describe the affine points
- **kwargsdict
Other keyword arguments to be passed to the subspace.
- Returns:
- ddg.geometry.Subspace
Subspace spanned by the given points
- ddg.geometry.subspace_from_columns(matrix, **kwargs)[source]
Create subspace using the columns of a matrix as points.
- Parameters:
- matrixnumpy.ndarray of shape (n+1,k+1)
- **kwargsdict
Other arguments to be passed to the Subspace.
- Returns:
- ddg.geometry.Subspace
Notes
An empty subspace can be created by giving a 0-matrix or a matrix with shape (n,0).
- ddg.geometry.subspace_from_rows(matrix, **kwargs)[source]
Create subspace using the rows of a matrix as points.
- Parameters:
- matrixnumpy.ndarray of shape (k+1,n+1)
- **kwargsdict
Other arguments to be passed to the Subspace.
- Returns:
- ddg.geometry.Subspace
Notes
An empty subspace can be created by giving a 0-matrix or a matrix with shape (0,n+1).
- ddg.geometry.whole_space(dimension, **kwargs)[source]
Create whole space of a certain dimension as a trivial subspace.
- Parameters:
- Dimensionint
Dimension of the space.
- **kwargs
Keyword arguments other than points to be passed to Subspace.
- Returns:
- ddg.geometry.Subspace
See also
- ddg.geometry.cayley_klein_sphere_to_quadric(sphere)[source]
Convert Cayley-Klein sphere to quadric.
- Parameters:
- sphereddg.geometry.spheres.CayleyKleinSphere or
- ddg.geometry.spheres.MetricCayleyKleinSphere
- Returns:
- ddg.geometry.Quadric
- ddg.geometry.generalized_cayley_klein_sphere_to_quadric(sphere)[source]
Convert generalized Cayley-Klein sphere to quadric.
- Parameters:
- sphereddg.geometry.spheres.GeneralizedCayleyKleinSphere
- Returns:
- ddg.geometry.Quadric
- ddg.geometry.quadric_to_subspaces(quadric)[source]
If a quadric is equal to a finite collection of subspaces, convert it.
This is the case if and only if Q = quadric.matrix is semidefinite or its rank is less than or equal to 2. In the first case, return ker(Q). Otherwise, return join(ker(Q), P1) and join(ker(Q), P2), where P1, P2 are the two points making up the non-degenerate part of the quadric.
- Parameters:
- quadricddg.geometry.Quadric
- Returns:
- tuple of ddg.geometry.Subspace
Notes
No non-degenerate quadric with ambient dimension at least 2 is equal to a collection of subspaces. A degenerate quadric Q is the join of its kernel with its non-degenerate part, i.e. the quadric obtained by restricting the quadratic form to a subspace complementary to the kernel. For this set to be a collection of subspaces, the non-degenerate part must itself be a collection of subspaces. This is only possible if it is contained in a line (i.e. the rank of Q is 2) or it is empty (i.e. Q is positive semidefinite).
- ddg.geometry.intersect(*objects, resolve=True)[source]
Intersect any number of supported geometric objects.
- Parameters:
- *objectsIterable of ddg.geometry.Subspace or ddg.geometry.Quadric
Any number of subspaces can be intersected with at most one quadric. Further, two quadrics can be intersected.
- Returns:
- ddg.geometry.Subspace, ddg.geometry.Quadric or ddg.geometry.QuadricIntersection
Intersection of the objects.
- Raises:
- ValueError
If no objects are handed to the function for intersection
- NotImplementedError
- If the objects are of any type other than
any number of ddg.geometry.Subspace with at most one ddg.geometry.Quadric
two ddg.geometry.Quadric
See also
- ddg.geometry.join(*objects, resolve=True)[source]
Join any number of supported geometric objects.
- Parameters:
- *objectsIterable of ddg.geometry.Subspace or ddg.geometry.Quadric
An arbitrary number of quadrics and subspaces can be joined.
- Returns:
- ValueError
If no objects are handed to the function for joining.
- NotImplementedError
If the objects are of any other type than ddg.geometry.Subspace or ddg.geometry.Quadric,
If at any point it is attempted to join two ddg.geometry.Quadrics,
If at any point it is attempted to join a ddg.geometry.Quadric and a ddg.geometry.Subspace which do not fulfill one of the three following cases: 1) The intersection of the subspace of the quadric and the subspace is empty, 2) The intersection is non-empty but the subspace is of the type ddg.geometry.Point, 3) The intersection is non-empty but the subspace contains the subspace of the quadric itself.
See also
- ddg.geometry.meet(*objects, resolve=True)
Intersect any number of supported geometric objects.
- Parameters:
- *objectsIterable of ddg.geometry.Subspace or ddg.geometry.Quadric
Any number of subspaces can be intersected with at most one quadric. Further, two quadrics can be intersected.
- Returns:
- ddg.geometry.Subspace, ddg.geometry.Quadric or ddg.geometry.QuadricIntersection
Intersection of the objects.
- Raises:
- ValueError
If no objects are handed to the function for intersection
- NotImplementedError
- If the objects are of any type other than
any number of ddg.geometry.Subspace with at most one ddg.geometry.Quadric
two ddg.geometry.Quadric
See also
- ddg.geometry.central_project(object_, target, center)[source]
Project the
object_onto thetargetwith respect to givencenterof projection.Currently supported types of objects and targets for central projection:
Subspace onto Subspace
Quadric onto Subspace
Subspace onto Quadric
The projection is obtained as the intersection oftargetandjoin(object_, center).Thus, in general case, a point of theobjectis mapped to a subspace or to a quadric.Such projection maps points to points whencenterandtargetare disjoint Subspaces with the sumcenter.dimension + target.dimension + 1equal to the dimension of their common ambient space.If, in addition, theobject_is a Subspace, the functioncentral_projectreturns the Subspace spanned by the images ofobject_.points.- Parameters:
- object_: ddg.geometry.Subspace or ddg.geometry.Quadric
Object to be projected.
- target: ddg.geometry.Subspace or ddg.geometry.Quadric
Subspace or Quadric to be projected onto.
- center: ddg.geometry.Subspace
- The center of projection.The most common example of
centeris a Point outside thetargetSubspace. However, the dimension ofcentermay also be positive.
- Returns:
- ddg.geometry.Subspace or ddg.geometry.Quadric
- Raises:
- NotImplementedError
If the pair of given objects’ types is currently not supported. If a quadric is given as
object_and is not contained in a proper subspace.
- ddg.geometry.central_project_complex(object_, target, center)[source]
- The complex mode of
central_projectfunction.Every real projective subspace or quadric can be treated as a slice of complex subspace or quadric.The
central_project_compleximplementation is equivalent the following procedure:consider complexified
object_,targetandcenter;take the image of complexified
object_under central projection with respect to complexifiedcenteronto complexifiedtarget;bring the image back to real space by forgetting its complex dimensions.
Currently supported types of objects and targets for central projection in complex mode:
Quadric onto Subspace
While projecting a quadric onto a subspace, the result will always be a subspace: either the whole
targetsubspace or its intersection with the subspace ofobject_quadric.- Parameters:
- object_ddg.geometry.Quadric
Quadric to project.
- targetddg.geometry.Subspace
Subspace to be projected onto.
- centerddg.geometry.Subspace
The center of projection.
- Returns:
- ddg.geometry.Subspace
- Raises:
- NotImplementedError
If the pair of given objects’ types is currently not supported.
- ddg.geometry.central_project_contour(object_, target, center)[source]
- Take the contour of image of
object_under projection onto thetargetwith respect to givencenterof projection.In other words, the functioncentral_project_contourreturns the boundary of the shadow (obtained viacentral_projectwith the same input) instead of the shadow itself.Currently supported types of objects and targets for central projection in contour mode:
Subspace onto Subspace
Quadric onto Subspace
Subspace onto Quadric
The contour of a proper subspace is considered to be the proper subspace itself. The contour of the whole space is the empty subspace.
When projecting the contour of a quadric contained in the whole space (i.e. not contained in any proper subspace), the center must be a point, but not as a subspace of larger dimension.In this case the functioncentral_project_contourreturns the intersection oftargetandtouching_coneto given quadric.- Parameters:
- object_: ddg.geometry.Subspace or ddg.geometry.Quadric
Object to be projected.
- target: ddg.geometry.Subspace or ddg.geometry.Quadric
Subspace or Quadric to be projected onto.
- center: ddg.geometry.Subspace
- The center of projection.If
object_is Quadric whosesubspaceattribute is the whole space, thencentermust be a Point (i.e. a Subspace of zero dimension).
- Returns:
- ddg.geometry.Subspace or ddg.geometry.Quadric
If the image of
object_has no boundary under central projection ontotarget, the functioncentral_project_contourreturns the empty object of expected type (i.e. Subspace or Quadric) in expected subspace.
- Raises:
- NotImplementedError
If the pair of given objects’ types is currently not supported. If
object_given as a quadric not contained in a proper subspace andcenteris not a point.
- ddg.geometry.inverse_stereographic_project(object_)[source]
- ddg.geometry.inverse_stereographic_project(point: Point, quadric=None, projection_point=None)
- ddg.geometry.inverse_stereographic_project(subspace: Subspace, quadric=None, projection_point=None)
- ddg.geometry.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.
Currently supported types of objects to be projected:
Point
Subspace
Sphere
- Parameters:
- object_
ddg.geometry.Subspaceorddg.geometry.spheres.SphereLike - Object (Point, Subspace or SphereLike) to be projected.The cases Point and Subspace are differentiated because of different types of output (Point and Quadric respectively).
- quadric: `ddg.geometry.Quadric` (default=None)
Quadric to project onto. Default is the Moebius quadric.
- projection_point: `ddg.geometry.Point` (default=None)
Center of projection. Must lie on
quadric. Default is the “north pole” [e_n+e_{n+1}].
- object_
- Returns:
- ddg.geometry.Point (if Point is given) or ddg.geometry.Quadric (otherwise)
- Raises:
- NotImplementedError
If given type of object is currently not supported. If
SphereLikeis given andthe intersection of
sphere.subspaceand the tangent plane atprojection_pointis not at infinity.the induced metric is distorted, i.e. planar sections of the
quadricwould not map to spheres insphere.subspace.the intersection of the line through
projection_pointandpolarize(sphere.subspace)withsphere.subspaceis at infinity. This point would normally act as a sort of origin.
- ValueError
If
projection_pointdoes not lie onquadric.
- ddg.geometry.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:
- sphereddg.geometry.spheres.CayleyKleinSphere
- quadricddg.geometry.Quadric
Quadric to lift to.
- projection_pointddg.geometry.Point
A point not on the quadric.
- Returns:
- ddg.geometry.Quadric, ddg.geometry.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.
- ddg.geometry.stereographic_project(object_)[source]
- ddg.geometry.stereographic_project(subspace: Subspace, hyperplane=None, projection_point=None)
- ddg.geometry.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.
- Currently supported types of objects to be projected:
Quadric
Subspace
- Parameters:
- object_
ddg.geometry.Quadricorddg.geometry.Subspace - Object (Quadric or Subspace) to be projected.Note that the object does not have to be contained by the Quadric from which the stereographic projection is implemented, since the image defined just by
projection_pointand targethyperplane.If given the Subspace coinciding withprojection_point, thennp.infis returned. - hyperplane: `ddg.geometry.Subspace` (default=None)
Hyperplane not containing
projection_pointto project onto. Default is the plane spanned by the homogeneous vectors e_1,…,e_n-1, e_{n+1}.- projection_point: `ddg.geometry.Point` (default=None)
Center of projection. Default is the “north pole” [e_n+e_{n+1}].
- object_
- Returns:
ddg.geometry.Quadric(if Quadric is given)- or
ddg.geometry.Subspaceorfloat(if Subspace is given)
- Raises:
- NotImplementedError
If given type of object is currently not supported.
Notes
In order to obtain
ddg.geometry.spheres.SphereLikefrom a Moebius sphere useddg.geometry.moebius_models.projective_to_euclideanorddg.geometry.euclidean_models.moebius_to_projective.