如何使用 latex 绘制 cos x * sinh y = c?

如何使用 latex 绘制 cos x * sinh y = c?

-pi/2 ≤ x ≤ pi/2。

c 是常数。你可以取 c = 1 或任何你喜欢的值

感谢帮助!

答案1

为了帮助您开始.....

\documentclass{article}

\usepackage{pgfplots}

\begin{document}


\begin{tikzpicture}
\begin{axis}
\addplot[domain=-3:3,samples=500,mark=none] {ln(1/cos(x)+sqrt(1+ (1/cos(x))^2)};
\end{axis}
\end{tikzpicture}
\end{document}

答案2

下面是一个带有 的代码。如果您设置了编译器开关(MiKTeX) 或(TeX Live, MacTeX),pstricks则可以用 进行编译。pdflatex--enable-write18-shell-escape

它绘制了函数y = ln((1+\sqrt(cos²x+1))/(cos x))

%%cos x sh y = 1
\documentclass[border=3pt, x11names]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{pst-plot}
\usepackage{auto-pst-pdf} 
\def\f{ln((1 + sqrt(1 + (COS(x))^2))/(COS(x)))}

\begin{document}

\psset{plotpoints=200, plotstyle=curve, algebraic, arrowinset=0.12, unit=1.5}%
\begin{pspicture*}(-2.95,-0.9)(3,4)
{\psset{linewidth=0.5pt, linecolor=Goldenrod1}
    \psline(-\pstPI2,-1)(-\pstPI2,6)
    \psline(\pstPI2,-1)(\pstPI2,6)}
    \psaxes[linecolor=LightSteelBlue3, tickcolor=LightSteelBlue3, ticksize=-2pt 2pt, xtrigLabels, arrows=->, trigLabelBase=2, dx = 1.57] (0,0)(-3,-1)(3,4)[$x$, -120][$y$, -135]
    %
    \psset{linewidth=1.5pt, linecolor=IndianRed3}
    \psplot{-\pstPI2}{\pstPI2}{\f}%
\end{pspicture*}

\end{document}

在此处输入图片描述

相关内容