# 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.0

## Types and functions

Most functions are directly implemented for an AbstractPowerManifold with ArrayPowerRepresentation except the following special cases:

ManifoldsBase.check_vectorMethod
check_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.

source

## Embedded Torus

Two-dimensional torus embedded in $ℝ^3$.

Manifolds.DefaultTorusAtlasType
DefaultTorusAtlas()

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(θ + θ₀)$$$
source
Manifolds.EmbeddedTorusType
EmbeddedTorus{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)
source
Manifolds.check_chart_switchMethod
check_chart_switch(::EmbeddedTorus, A::DefaultTorusAtlas, i, a; ϵ = pi/3)

Return true if parameters a lie closer than ϵ to chart boundary.

source
ManifoldsBase.check_pointMethod
check_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 apprximately equal to $4R^2(p_1^2 + p_2^2)$.

source