6

3

How do I get the InputField to coordinate with the LocatorPane so that a change in each control changes the other to be in agreement? It would be nice if the function was self-contained and was dynamically linked to a second similar control where the variable is radians. The angle control is based on this (see Applications). Related links do not address or solve this particular issue; links such as this this, and this

```
fDeg[Dynamic[angleDeg_]] :=
DynamicModule[{p, angleRad, angleCalc, dtr = Degree},
angleCalc[newp_,
oldp_] := (angleRad =
angleRad + ArcCos[newp.oldp] Sign[Cross[newp].(newp - oldp)];
If[0 < angleRad, angleRad = Mod[angleRad, +2*Pi]];
If[0 > angleRad, angleRad = Mod[angleRad, -2*Pi]];
angleDeg = angleRad/dtr;
f[angleDeg];
p = {Cos[angleRad], Sin[angleRad]});
angleRad = angleDeg*dtr;
p = {Cos[angleRad], Sin[angleRad]};
LocatorPane[Dynamic[p, (angleCalc @@ Normalize /@ {#, p}) &],
Dynamic@Show[
Graphics[{Circle[], Arrowheads[0.15],
Arrow[Dynamic[{{0, 0}, p}]]}, ImageSize -> Tiny],
Graphics[{Dynamic[{Text[
NumberForm[angleDeg, {3, 2}], {0, 0}]}]}]],
Appearance -> None]];
aDeg = 45;
Column[{
"Degrees:",
fDeg[Dynamic[aDeg]],
"aDeg: ",
InputField[Dynamic[aDeg],
FieldSize -> 6]
}, Alignment -> Center]
```

MarcoB. This is nice. But I was hoping for a self-contained function where only aDeg is passed. One reason for this is to allow aDeg to be altered elsewhere by some process such as a simulation of an automated flight control system. The controls (LocatorPane and InputField) would change accordingly. But the simulation could be interrupted by the user by means of the controls, and a new value input by the field or the dial. Any thoughts? – kmutiny – 2019-03-11T02:25:01.023