-2
$\begingroup$
l1 = Graphics[Line[{{0, 1}, {2, 1}}]];
l2 = Graphics[Line[{{subDiv, 0}, {subDiv, 2 subDiv}}]];
dotl3 = Graphics[{Dashed, 
                  Line[{{0, subDiv/2}, {2 subDiv, subDiv/2}}]}];
dotl4 = Graphics[{Dashed, 
                  Line[{{0, 3*(subDiv/2)}, {2 subDiv, 3*(subDiv/2)}}]}];
dotl5 = Graphics[{Dashed, 
                  Line[{{subDiv/2, 0}, {subDiv/2, 2 subDiv}}]}];
dotl7 = Graphics[{Dashed, 
                  Line[{{3*(subDiv/2), 0}, {3*(subDiv/2), 2 subDiv}}]}];
circ1 = Graphics[Circle[{subDiv/2, subDiv/2}, .4]];
circ2 = Graphics[Circle[{3*(subDiv/2), 3*(subDiv/2)}, .4]];
fullFigure = Show[l1, l2, dotl3, dotl4, dotl5, dotl7]

xde[x_] := (Sin[x]*.5) + subDiv/2;
yde[x_] := (Cos[x]*.5) + subDiv/2; 
xde2[x_] := (Sin[x]*.5) + 3*subDiv/2;
yde2[x_] := (Cos[x]*.5) + 3*subDiv/2;

animateCircle = 
  Manipulate[
    Show[{ParametricPlot[{xde[t], yde[t]}, {t, 0, 10}], 
          ParametricPlot[{xde2[t], yde2[t]}, {t, 0, 10}], 
          Graphics[{Red, PointSize[.05], Point[{yde[s1*T], xde[s1*T]}]}], 
          Graphics[{Red, PointSize[.05], 
                    Point[{yde2[s2*T - w], xde2[s2*T - w]}]}],
          p1 = ParametricPlot[{yde[s1*T], t}, {t, xde[s1*T], 2}, 
                               PlotStyle -> Red], 
          p2 = ParametricPlot[{t, xde2[s2*T - w]}, {t, -.1, yde2[s2*T - w]},
                                PlotStyle -> Red],
          Show[fullFigure]}, 
      PlotRange -> All, Axes -> False
    ],
   {T, 0, 10 Pi}, {w, 0, -2 Pi}, {s1, 1, 5}, {s2, 1, 5}
  ]

How do I solve for the point created by the intersected two red lines?

$\endgroup$
4
$\begingroup$

You need to define subDiv. Then the intersection of the red lines is the point {yde[s1*T], xde2[s2*T-w]}

subDiv = 1;

gr = Graphics[{
    Line[{{0, 1}, {2, 1}}],
    Line[{{subDiv, 0}, {subDiv, 2 subDiv}}],
    Dashed,
    Line[{{0, subDiv/2}, {2 subDiv, subDiv/2}}], 
    Line[{{0, 3*subDiv/2}, {2 subDiv, 3*subDiv/2}}], 
    Line[{{subDiv/2, 0}, {subDiv/2, 2 subDiv}}], 
    Line[{{3*(subDiv/2), 0}, {3*(subDiv/2), 2 subDiv}}]}];

xde[x_] := Sin[x]/2 + subDiv/2;
yde[x_] := Cos[x]/2 + subDiv/2;
xde2[x_] := Sin[x]/2 + 3*subDiv/2;
yde2[x_] := Cos[x]/2 + 3*subDiv/2;

animateCircle = Manipulate[
  Show[{
    ParametricPlot[{
      {xde[t], yde[t]},
      {xde2[t], yde2[t]}}, {t, 0, 10}], 
    Graphics[{Red, PointSize[.05], Point[{yde[s1*T], xde[s1*T]}], 
      Point[{yde2[s2*T - w], xde2[s2*T - w]}],
      Blue,
      Point[{yde[s1*T], xde2[s2*T - w]}]}], 
    p1 = ParametricPlot[{yde[s1*T], t}, {t, xde[s1*T], 2}, PlotStyle -> Red], 
    p2 = ParametricPlot[{t, xde2[s2*T - w]}, {t, -.1, yde2[s2*T - w]}, 
      PlotStyle -> Red], gr}, PlotRange -> All, Axes -> False],
  {T, 0, 10 Pi, Appearance -> "Labeled"},
  {w, 0, -2 Pi, Appearance -> "Labeled"},
  {s1, 1, 5, Appearance -> "Labeled"},
  {s2, 1, 5, Appearance -> "Labeled"}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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