Can anyone help me how to draw a Bicuspid curve using Latex?
- 22,451
-
3Welcome to TeX.SX! You'll get probably an answer faster if you include a picture of the function that you want to draw. It would also help to see some compilable LaTeX code that shows your setup and the package that you intend to use. There are several options, which differ e.g. in the output format (Postscript vs PDF). – gernot Jan 15 '21 at 14:04
-
Thanks for the tip. – Emanuel Furtado Jan 15 '21 at 14:12
2 Answers
Compile with Asymptote or http://asymptote.ualberta.ca/
import contour;
import graph;
size(300);
typedef real newreal(real,real);
newreal f(real a){
return new real(real x, real y){
return (x^2-a^2)*(x-a)^2+(y^2-a^2)^2;
// from https://mathworld.wolfram.com/BicuspidCurve.html
};
}
xaxis(xmin=-2,xmax=2,RightTicks(Step=0.5),Arrow);
yaxis(ymin=-2,ymax=2,LeftTicks(Step=0.5,modify=NoZero),Arrow);
draw(contour(f(1),(-2,-2),(2,2),new real[]{0},1000),red+1bp);
Here is a short code with the pst-contourplot pstricks package:
\documentclass[border=10pt, svgnames]{standalone}
\usepackage{pst-plot, pst-contourplot}
\begin{document}
\psset{unit=2cm, algebraic, plotstyle=curve, plotpoints=200, linejoin=1}
\begin{pspicture}(-1.8,-2)(1.8,2)
\psaxeslinecolor=LightSteelBlue, arrows=->, arrowinset=0.12, ticksize=3.5pt, tickcolor=DarkBlue, subticks=5,showorigin=false(-1.75,-1.9)(1.75,2)[$x$, -120][$y$,-135]
\psContourPlotlinecolor=Crimson, linewidth=1.5pt, function=(x^2-1)*(x-1)^2 + (y^2-1)^2(1.1,1.75)
\end{pspicture}
\end{document}
- 271,350


