# How to find the intersection of line and contourplot?

The first question.

Why can't we use linestyle=none for \psContourPlot in the following example?

\documentclass[pstricks,border=10pt]{standalone}
\begin{document}
\def\funcone{6-x}
\def\functwo{7-x}
\begin{pspicture}(-1,-1)(8,8)
\psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]
\psclip[algebraic,linestyle=none]{%
\pscustom{\psplot{0}{6}{\funcone}   \psplot{7}{0}{\functwo}     \closepath} }
\psContourPlot[a=0.05,algebraic,
Fill,fillcolor=green!50!orange,
function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
\endpsclip
\end{pspicture}
\end{document}


The second question.

\documentclass[pstricks,border=10pt]{standalone}
\begin{document}
\def\funcone{6-x}
\def\functwo{7-x}
\begin{pspicture}(-1,-1)(8,8)
\psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]
\psclip[algebraic,linestyle=none]{%
\pscustom{\psplot{0}{6}{\funcone}   \psplot{7}{0}{\functwo}     \closepath} }
\psContourPlot[a=0.05,algebraic,
Fill,fillcolor=green!50!orange,
function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
\endpsclip
\psplot[linestyle=dashed,linecolor=red,algebraic]{0}{6}{\funcone}
\psplot[linestyle=dashed,linecolor=red,algebraic]{0}{7}{\functwo}
\psContourPlot[algebraic,a=0.05,linecolor=red,function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
%%%
\pnodes(1,4){A}(5,0){B}
\psline(A)(B)
\pstMiddleAB[PointName=none]{A}{B}{K} \uput[0](K){$K(3,2)$}
\pstRotation[PosAngle=90,RotAngle=90]{K}{A}[C]
%%%%
\pssavepath{line}{\psline(K)(C)}
\pssavepath{func}{\psContourPlot[algebraic,a=0.05,linestyle=none,function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)}
%   \psintersect[showpoints,name=C]{line}{func}
\end{pspicture}
\end{document}


I see a message that has content as following:

My aim is intersection...

• \pssavepath can only handle commands, which are also allowed inside of \pscustom. Oct 7 '19 at 15:15

Same problem here. Use the identical curve defined as an ellipse:

\documentclass[pstricks,border=10pt]{standalone}
\begin{document}
\begin{pspicture}(-1,-1)(8,8)
\psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]
\psclip{\psellipse[rot=-45,linestyle=dashed](3,2)(2.85,1.65)}
\pspolygon[linestyle=none,fillstyle=solid,fillcolor=red!50](6,0)(7,0)(0,7)(0,6)
\endpsclip
\psellipse[rot=-45,linestyle=dashed](3,2)(2.85,1.65)
\psset{linecolor=red,linestyle=dashed}
\psline(7,0)(0,7)\psline(6,0)(0,6)
\psset{linecolor=blue,linestyle=dashed}

• Yes, I see ah. For drawing contourplot, Asymptote is the best choice!