这是我的代码。
\documentclass[pstricks]{standalone}
\usepackage{pst-intersect}
\usepackage{pst-eucl,pstricks-add,pst-calculate}
\usepackage{pstricks-add,pst-calculate}
\usepackage{auto-pst-pdf}
\begin{document}
\multido{\ry=0.3+0.1}{13}{%
\begin{pspicture}[showgrid,algebraic](-5,-5)(5,5)
\psset{PointName=none,PointSymbol=none}
\def\a{1}
\def\xo{\ry}
\def\func{\a*x^2}
\def\derivative{\a*2*x}
\def\derivativexo{\pscalculate{\xo*\a*2}}
\def\yo{\pscalculate{\a*\xo^2}}
\pnodes(\xo,\yo){A}(5,0){B}(0,0){O}
\pssavepath[linestyle=none]{pathA}{\psplot{-2}{2}{\derivativexo*(x-\xo)+\yo}} %% y=f'(x0)(x-x0)+y0
\pssavepath[linestyle=none]{pathB}{\psline(0,0)(5,0)}
\psintersect[name=C]{pathA}{pathB}
\pstBissectBAC[linestyle=none]{B}{C1}{A}{A'}
\pstRotation[RotAngle=90]{A}{C1}[N]
\pstInterLL{A}{N}{C1}{A'}{E}
\pstProjection{O}{B}{E}[K]
\pscustom[fillstyle=solid,fillcolor=gray!50!orange,linestyle=none]{%
\psplot{\xo}{0}{\func}
\psline(0,0)(K)
\pstArcnOAB[linestyle=none]{E}{K}{A}
\closepath}
\psplot{-2}{2}{\func}
\pstCircleOA[Radius=\pstDistAB{E}{A}]{E}{}
\psline{->}(-2,0)(4,0)
\psline{->}(0,-2)(0,4.25)
\rput(0.75,2.5){$y=ax^2$}
\end{pspicture}
}
\end{document}
注意:如果您想说一些新的东西,您可以重现我的代码!
答案1
给定抛物线上的点 P0(x0,y0)。斜率由导数给出。直线 P0-Mcircle 的斜率为负倒数:-1/(2ax0)。
圆的原点是 O(x0+Delta,radius)。Delta 是 radius*sin(alpha):
\documentclass[pstricks]{standalone}
\usepackage{pstricks-add,xfp}% xfp is the same as pst-calculate
\usepackage{auto-pst-pdf}
\begin{document}
\def\a{1}
\def\func{\a*x^2}
\multido{\rx=0.3+0.1}{15}{%
\begin{pspicture}[showgrid,algebraic](-1,-1)(7.5,7.5)
\psplot{-1}{3}{\func}%
\def\Alpha{\fpeval{atan(2*\a*\rx)}}% in radiant
\def\radius{\fpeval{\a*\rx*\rx/(1+sin(\Alpha)/(2*\a*\rx))}}%
\pnode(!\rx\space\radius\space\Alpha\space RadtoDeg sin mul add \radius){O}%\psdot(O)%
\pscircle(O){\radius}%
\pscustom[fillstyle=solid,fillcolor=gray!50!orange,linestyle=none,opacity=0.6]{%
\psarc(O){\radius}{!180 \Alpha\space sub}{270}
\psline(0,0)
\psplot{0}{\rx}{\func}
}%
\psline{->}(-1,0)(7,0)
\psline{->}(0,-1)(0,7.25)
\rput(0.75,2.5){$y=ax^2$}
\end{pspicture}%
}
\end{document}