1
$\begingroup$

I use this Manipulate:

Manipulate[Graphics[{{Blue, Circle[]},
        {Dashed, Line[{{0, 0}, pt}]}, {Red, InfiniteLine[pt, Cross[pt]]}},
        Axes -> True, PlotRange -> 3/2],
        {{pt, {1, 1}/Sqrt[2]}, Locator, TrackingFunction -> ((pt = Normalize[#]) &)}]

pt will be a pair of values {pntx, pnty}.

How can I get pntx or pntx?

$\endgroup$
1
  • $\begingroup$ There's a + button in the upper left. Click on it and select "Paste Snapshot" from the popup menu. $\endgroup$
    – Michael E2
    Commented May 16, 2017 at 1:20

1 Answer 1

3
$\begingroup$

You can always store the value in other symbol.

Manipulate[
 pntx = First[pt];
 pnty = Last[pt];
 Graphics[{{Blue, Circle[]}, {Dashed, Line[{{0, 0}, pt}]}, {Red, 
    InfiniteLine[pt, Cross[pt]]}}, Axes -> True, 
  PlotRange -> 3/2], {{pt, {1, 1}/Sqrt[2]}, Locator, 
  TrackingFunction -> ((pt = Normalize[#]) &)}]

Now pntx and pnty contains the individual coordinate values, which are normalised by your TrackingFunction .

Norm[{pntx, pnty}]
1

other alternatives:

{pntx, pnty} = pt;

pntx = Part[pt,1];
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.