Start with the following parametric equations of a torus:
R = 2; r = 1;
x3[ϕ_, θ_] := (r Cos[ϕ] + R) Cos[θ]
y3[ϕ_, θ_] := (r Cos[ϕ] + R) Sin[θ]
z3[ϕ_, θ_] := r Sin[ϕ]
I construct a function f
whose inputs of interest will be pairs {{s, t}, {u, v}}
of points on the circle of radius 1 centered at the origin in the plane, that is, on Circle[]
. Like this:
f[{{s_, t_}, {u_, v_}}] :=
Module[
{θ = ArcTan[s, t], ϕ = ArcTan[u, v]},
{x3[ϕ, θ], y3[ϕ, θ], z3[ϕ, θ]}
]
(The values of f
at such points should turn out to be points on the torus.)
So as to display values of f
dynamically for such points, I would like to do something like the following, with a pair of controls:
Manipulate[
f[{{s, t}, {u, v}}],
{s, t} ∈ Circle[], {u, v} ∈ Circle[]
]
Of course that's nonsense: the manipulate arguments are not of the correct form for variable specification.
What's the simplest way to accomplish that without faking it by parameterizing the circle first, as in the following?
Manipulate[
{u, v} = {Cos[ϕ], Sin[ϕ]};
{s, t} = {Cos[θ], Sin[θ]};
f[{{s, t}, {u, v}}],
{θ, 0, 2 π}, {ϕ, 0, 2 π}
]
Could it be done, for example, by using as controls two locators, one for each of the two copies of the circle?
I am aware of Constrain Locator to specified region. However, in that post the variable is in a region, whereas a circle is not a region as I understand the term.
Locator[]
, there is an example showing how to constrain locators to a circle. $\endgroup$