Skip to content

Instantly share code, notes, and snippets.

@chiangqiqi
Created April 18, 2017 15:10
Show Gist options
  • Save chiangqiqi/3d4b0b6f3d6bbb99bdcc910d39370814 to your computer and use it in GitHub Desktop.
Save chiangqiqi/3d4b0b6f3d6bbb99bdcc910d39370814 to your computer and use it in GitHub Desktop.
画圆
Manipulate[
Module[
{m={-2000,1500},
n={8000, 1500},
radius=15000
},
yuan[\[Alpha]_]={radius* Cos[\[Alpha]],radius*Sin[\[Alpha]]}+m;
With[{p=yuan[\[Alpha]]},
E=m+t*{p-m};
ts=Solve[
EuclideanDistance[E,n]==(1-t)*radius, t];
Graphics[
{
Point/@{m, n,p},
Circle[m, radius],
Line[{m, p}], Point[m+ts*{p-m}]
}]]]
,{\[Alpha], 0, 2 \[Pi]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment