A want to add the inverse trig.function for tangens to the code of asymptote. Thank you for adivise.
settings.outformat="pdf";
unitsize(2.5cm);
import graph;
real xmin = -pi/2;
real xmax = pi/2;
real ymin = -pi/2;
real ymax = pi/2;
xlimits(xmin,xmax);
ylimits(ymin,ymax);
//axis and the grid :
xaxis(Label("$x$",align=2E),Ticks("$%.2f$",new real[]{xmin,-1,1,xmax},Size=1mm,1bp),Arrow);
yaxis(Label("$y$",align=2N),Ticks("$%.2f$",new real[]{xmin,-1,1,xmax},Size=1mm,1bp),Arrow);
// function y=sin(x)
real f(real x) {return sin(x)/cos(x); }
path g = graph(f,xmin+0.5, xmax-0.5);
draw(g,red,
L= Label("$y=tan(x)$", UnFill,
position=EndPoint));
// function y=x
draw((xmin-0.25,ymin-0.25)--(xmax+0.25,ymax+0.25),
L= Label("$y=x$", UnFill,position=EndPoint));
atan
for arctangent in radians,aTan
for degrees. See asymptote.sourceforge.io/doc/…. You can compute arccotan from arctan.y=x
, so one way is rotate it to x-axis, reflex to y-axis, then rotate back, and we get the graph of the inverse. This wayrotate(45)*yscale(-1)*rotate(-45)
works for any curve.// http://asymptote.ualberta.ca/ unitsize(1cm); import graph; import math; axes("$x$","$y$"); drawline((0,0),(1,1),gray+.3pt); real dx=.35; path g = graph(tan,-pi/2+dx, pi/2-dx); draw(g,red); draw(rotate(45)*yscale(-1)*rotate(-45)*g,blue);