Torus
The torus $𝕋^d ≅ [-π,π)^d$ is modeled as an AbstractPowerManifold of the (real-valued) Circle and uses ArrayPowerRepresentation. Points on the torus are hence row vectors, $x ∈ ℝ^{d}$.
Example
The following code can be used to make a three-dimensional torus $𝕋^3$ and compute a tangent vector:
using Manifolds
M = Torus(3)
p = [0.5, 0.0, 0.0]
q = [0.0, 0.5, 1.0]
X = log(M, p, q)3-element Vector{Float64}:
-0.5
0.5
1.0Types and functions
Most functions are directly implemented for an AbstractPowerManifold with ArrayPowerRepresentation except the following special cases:
Manifolds.Torus — TypeTorus{N} <: AbstractPowerManifoldThe n-dimensional torus is the $n$-dimensional product of the Circle.
The Circle is stored internally within M.manifold, such that all functions of AbstractPowerManifold can be used directly.
ManifoldsBase.check_point — Methodcheck_point(M::Torus{n},p)Checks whether p is a valid point on the Torus M, i.e. each of its entries is a valid point on the Circle and the length of x is n.
ManifoldsBase.check_vector — Methodcheck_vector(M::Torus{n}, p, X; kwargs...)Checks whether X is a valid tangent vector to p on the Torus M. This means, that p is valid, that X is of correct dimension and elementwise a tangent vector to the elements of p on the Circle.
Embedded Torus
Two-dimensional torus embedded in $ℝ^3$.
Manifolds.DefaultTorusAtlas — TypeDefaultTorusAtlas()Atlas for torus with charts indexed by two angles numbers $θ₀, φ₀ ∈ [-π, π)$. Inverse of a chart $(θ₀, φ₀)$ is given by
\[x(θ, φ) = (R + r\cos(θ + θ₀))\cos(φ + φ₀) \\ y(θ, φ) = (R + r\cos(θ + θ₀))\sin(φ + φ₀) \\ z(θ, φ) = r\sin(θ + θ₀)\]
Manifolds.EmbeddedTorus — TypeEmbeddedTorus{TR<:Real} <: AbstractDecoratorManifold{ℝ}Surface in ℝ³ described by parametric equations:
\[x(θ, φ) = (R + r\cos θ)\cos φ \\ y(θ, φ) = (R + r\cos θ)\sin φ \\ z(θ, φ) = r\sin θ\]
for θ, φ in $[-π, π)$. It is assumed that $R > r > 0$.
Alternative names include anchor ring, donut and doughnut.
Constructor
EmbeddedTorus(R, r)Manifolds.affine_connection — Methodaffine_connection(M::EmbeddedTorus, A::DefaultTorusAtlas, i, a, Xc, Yc)Affine connection on EmbeddedTorus M.
Manifolds.check_chart_switch — Methodcheck_chart_switch(::EmbeddedTorus, A::DefaultTorusAtlas, i, a; ϵ = pi/3)Return true if parameters a lie closer than ϵ to chart boundary.
Manifolds.gaussian_curvature — Methodgaussian_curvature(M::EmbeddedTorus, p)Gaussian curvature at point p from EmbeddedTorus M.
Manifolds.inverse_chart_injectivity_radius — Methodinverse_chart_injectivity_radius(M::AbstractManifold, A::AbstractAtlas, i)Injectivity radius of get_point for chart i from the DefaultTorusAtlas A of the EmbeddedTorus.
Manifolds.normal_vector — Methodnormal_vector(M::EmbeddedTorus, p)Outward-pointing normal vector on the EmbeddedTorus at the point p.
ManifoldsBase.check_point — Methodcheck_point(M::EmbeddedTorus, p; kwargs...)Check whether p is a valid point on the EmbeddedTorus M. The tolerance for the last test can be set using the kwargs....
The method checks if $(p_1^2 + p_2^2 + p_3^2 + R^2 - r^2)^2$ is approximately equal to $4R^2(p_1^2 + p_2^2)$.
ManifoldsBase.check_vector — Methodcheck_vector(M::EmbeddedTorus, p, X; atol=eps(eltype(p)), kwargs...)Check whether X is a valid vector tangent to p on the EmbeddedTorus M. The method checks if the vector X is orthogonal to the vector normal to the torus, see normal_vector. Absolute tolerance can be set using atol.
ManifoldsBase.inner — Methodinner(M::EmbeddedTorus, ::DefaultTorusAtlas, i, a, Xc, Yc)Inner product on EmbeddedTorus in chart i in the DefaultTorusAtlas. between vectors with coordinates Xc and Yc tangent at point with parameters a. Vector coordinates must be given in the induced basis.
ManifoldsBase.is_flat — Methodis_flat(::EmbeddedTorus)Return false. EmbeddedTorus is not a flat manifold.
ManifoldsBase.manifold_dimension — Methodmanifold_dimension(M::EmbeddedTorus)Return the dimension of the EmbeddedTorus M that is 2.