ddg.math.parametrizations package
Submodules
- ddg.math.parametrizations.confocal2d module
- ddg.math.parametrizations.confocal3d module
- ddg.math.parametrizations.discrete_confocal2d module
discrete_confocal_conics_gamma()discrete_confocal_conics_gamma_u1()discrete_confocal_conics_gamma_u2()discrete_confocal_conics_trigonometric()discrete_confocal_conics_trigonometric_u1()discrete_confocal_conics_trigonometric_u2()discrete_confocal_conics_concentric()discrete_confocal_conics_concentric_u1()discrete_confocal_conics_concentric_u2()discrete_confocal_conics_ic_ellipse()discrete_confocal_conics_ic_ellipse_u1()discrete_confocal_conics_ic_ellipse_u2()discrete_confocal_conics_ic_hyperbola()discrete_confocal_conics_hyperbolic_pencil()discrete_confocal_conics_hyperbolic_pencil_u1()discrete_confocal_conics_hyperbolic_pencil_u2()
- ddg.math.parametrizations.discrete_confocal3d module
- ddg.math.parametrizations.discrete_ellipsoids module
Module contents
- ddg.math.parametrizations.circle(t, center, radius=1, normals=None)[source]
Parametrization map of a circle with a given center, radius and list of normals. The dimensions of the normals must match the dimension of the center and both must be >= 2.
- Parameters:
- t: float
Parameter for the parametrization.
- center: numpy.ndarray of shape (d,)
Center of the circle.
- radius: float (default=1)
Radius of the circle.
- normals: numpy.ndarray of shape (n,d) (default=None)
Normals of the circle that determine the orthogonal complement of the subspace containing the circle. If None are given the orthogonal complement will be determined by the dimension of the center and its normals consist of unit normal vectors. These vectors must be linearly independent(!)
- Returns:
- float
Value of a point on the circle at parameter t.
- Raises:
- ValueError
If the shapes of center and normals do not match. If the number of normals is not smaller than the dimension of the circle center minus 2.
Examples
>>> import numpy as np >>> from ddg.math.parametrizations import circle >>> circle(0, (0, 0, 0), radius=1, normals=None) array([1., 0., 0.])
- ddg.math.parametrizations.elliptic_curve_jacobi(u, k)[source]
Parametrization for an elliptic curve [cn, sn, dn] for a parameter k.
- ddg.math.parametrizations.mobius_strip(u, v, R)[source]
Parametrization of the moebius strip.
- Parameters:
- ufloat
The value of the first parameter.
- vfloat
The value of the second parameter.
- Rfloat
Radius of the midcircle of the moebius strip.
- Returns:
- np.ndarray of shape (3, 1)
Examples
>>> from ddg.math.parametrizations import mobius_strip >>> mobius_strip(0, 1, 2) array([2.5, 0. , 0. ])
- ddg.math.parametrizations.sphere(u, v, center=None, radius=1)[source]
Parameterization map of a 2d sphere in 3d euclidean space with a given center and radius
- Parameters:
- u: float
First parameter for the parametrization.
- v: float
Second parameter for the parametrization.
- center: array_like of shape (3,), (default=None)
Center of the sphere.
- radius: float (default=1)
Radius of the sphere.
- Returns:
- float
Value of the sphere parametrization for given parameters u and v.
- Raises:
- ValueError
If center is not 3-dimensional.
Examples
>>> import numpy as np >>> from ddg.math.parametrizations import sphere >>> sphere(0, np.pi / 2, center=(0, 0, 0), radius=1) array([1.000000e+00, 0.000000e+00, 6.123234e-17])
- ddg.math.parametrizations.torus(phi, theta, R, r)[source]
Parametrization of the torus.
- Parameters:
- phifloat
The value of the first parameter.
- thetafloat
The value of the second parameter.
- Rfloat
Radius of the larger circle.
- rfloat
Radius of the smaller circle.
- Returns:
- np.ndarray of shape (3, 1)
Examples
>>> import numpy as np >>> from ddg.math.parametrizations import torus >>> torus(np.pi / 2, np.pi / 2, 2, 1) array([1.2246468e-16, 2.0000000e+00, 1.0000000e+00])