두 함수의 그래프 사이의 영역

두 함수의 그래프 사이의 영역

에 대한 후속 질문입니다.곡선 사이의 면적.

어느 날 LaTeX(Miktex)에서 이를 수행하는 방법을 알게 되었습니다.

\documentclass[10pt]{article}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-3.5,-0.5)(4,7)
\begin{psclip}{
      \psplot[linestyle=none,algebraic,plotpoints=2000]{-3}{3}{x^2+1}%
       \psline[linestyle=none,algebraic,plotpoints=2000](-1,1)(-1,2)(2,5)(2,1)
  }%
       \psframe*[linecolor=cyan,fillstyle=solid](-1,1)(2,5)
\end{psclip}
   \psplot[algebraic,plotpoints=2000,yMaxValue=5.6]{-2.3}{2.3}{x^2+1}
    \psplot[algebraic,plotpoints=2000]{-3.5}{2.5}{x+3}
\psaxes{->}(0,0)(-3.5,-.9)(4,6.5)
\uput[-90](3.9,-.2){$x$}
\uput[-135](-.2,6.7){$y$}
\end{pspicture}
\end{document}

두 함수의 그래프 사이의 영역

다음 코드가 작동하지 않는 것이 이상합니다.

\documentclass[10pt]{article}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-3.5,-0.5)(4,7)
\begin{psclip}{
      \psplot[linestyle=none,algebraic,plotpoints=2000]{-1.2}{2.2}{x^2+1}%
       \psplot[linestyle=none,algebraic,plotpoints=2000]{-1.2}{2.2}{x+3}
  }%
       \psframe*[linecolor=cyan,fillstyle=solid](-1,1)(2,5)
\end{psclip}
   \psplot[algebraic,plotpoints=2000,yMaxValue=5.6%,linecolor=cyan
    ]{-2.3}{2.3}{x^2+1}
    \psplot[algebraic,plotpoints=2000]{-3.5}{2.5}{x+3}
\psaxes{->}(0,0)(-3.5,-.9)(4,6.5)
\uput[-90](3.9,-.2){$x$}
\uput[-135](-.2,6.7){$y$}
\end{pspicture} 
\end{document}

문제는 f(x)= ax + b와 같은 함수에 있는 것 같습니다.

나 맞아?

답변1

내부 에 사용된 곡선을 감싸십시오 psclip.\pscustom 로 감싸고,넣다우주. 이를 위해 선형 함수의 시작/끝 지점을 바꿨습니다 x+3.

여기에 이미지 설명을 입력하세요

\documentclass{article}

\usepackage{pstricks-add}

\begin{document}

\begin{pspicture}(-3.5,-0.5)(4,7)
  \begin{psclip}{
    \pscustom[linestyle=none,algebraic,plotpoints=2000]{
      \psplot{-1.2}{2.2}{x^2+1}%
      \psplot{2.2}{-1.2}{x+3}
    }
  }%
    \psframe*[linecolor=cyan,fillstyle=solid](-1,1)(2,5)
  \end{psclip}
  \psplot[algebraic,plotpoints=2000,yMaxValue=5.6%,linecolor=cyan
    ]{-2.3}{2.3}{x^2+1}
  \psplot[algebraic,plotpoints=2000]{-3.5}{2.5}{x+3}
  \psaxes{->}(0,0)(-3.5,-.9)(4,6.5)
  \uput[-90](3.9,-.2){$x$}
  \uput[-135](-.2,6.7){$y$}
\end{pspicture} 

\end{document}

관련 정보