I have a problem in defining the local variables.
I have this code:
Manipulate[
Grid[{
{Grid[{
{k, Cos[k] // N},
{a = Dynamic[p], y = Cos[a], Sin[y]}
}]},
{Grid[{{
Graphics[{
{Gray, Line[RandomReal[{-1, 1}, {1000, 2}]]}, {Red,
Disk[a, 0.05]}}, PlotRange -> {{-1, 1}, {-1, 1}},
ImageSize -> 500
]}}
]}}], {{p, {0, 0}}, Locator}, {k, 1, 10, 1}]
if you notice that for certain value of k, p is dynamically located and then a is set to be equal to a, but when calculating Cos[a], this expression is not calculated and neither sin[y].
How to make the dynamic variables and all of its dependents only the variables who changes. I tried Dynamic but only the dynamic variable is changing not its dependents.
can you please suggest some way to make the dynamic variable and all of its dependents changing?

y=Cos[Setting@a]to get at the value ofa. – kglr Apr 23 '14 at 21:45Dynamicsince the wholeManipulatebody is wrapped with this. The problem is also thatDynamic[5]is not a number. – Kuba Apr 23 '14 at 22:05