/* -*-ePiX-*- */ #include "epix.h" using namespace ePiX; double xi(1.5), xi1(0.7), xi2(0.5*(xi + xi1)), xip(-0.6), xipp(0.4), ht(0.8), eps(0.0001); // continuous double f1(double x) { double u(x - 0.5*xipp); return ht - 0.5*(0.25*x + fabs(u)) + 0.1*pow(u, 4); } // discontinuous double f2(double x) { if (x < xip) return 0.75 + 0.5*(1+x)*(1+x); else if (x < xipp) return 0.5*sqrt(xi1 - x); else return 0.25 - 0.33*x*(x - 0.75)*(x - 3); } int main() { picture(P(-1, 0), P(2, 1), "4.5 x 1.5in"); begin(); bold(); line(P(xmin(), 0), P(xmax(), 0)); line(P(0,0), P(0, ymax())); plot(f2, xmin(), xip - eps, 20); plot(f2, xip, xipp - eps, 40); plot(f2, xipp, xmax(), 40); pen(1.5); plot(f1, xmin(), xmax(), 120); bold(); dashed(); dash_size(6); line(P(xip, 0), P(xip, f2(xip - eps))); line(P(xipp, 0), P(xipp, f2(xipp - eps))); line(P(xi1, 0), P(xi1, f2(xi1))); line(P(xi2, 0), P(xi2, f2(xi2))); line(P(xi, 0), P(xi, f1(xi))); label(P(xmax(), 0), P(0,-4), "$X$", b); label(P(0, ymax()), P(4, 0), "$Y$", r); label(P(xip, 0), P(0, -4), "$\\xi'$", b); label(P(0, 0), P(0, -4), "$0$", b); label(P(xipp, 0), P(0, -4), "$\\xi''$", b); label(P(xi1, 0), P(0, -4), "$\\xi_{1}$", b); label(P(xi2, 0), P(0, -4), "$\\xi_{2}$", b); label(P(xi, 0), P(0, -4), "$\\xi$", b); label(P(xmax(), f1(xmax())), P(4, 0), "$C$", r); label(P(xip - 0.2, f2(xip - 0.2)), P(0,4), "$C'$", t); label(P(xip + 0.3, f2(xip + 0.3)), P(0,-4), "$C'$", b); label(P(xi, f2(xi)), P(0,4), "$C'$", t); label(P(xi, f1(xi)), P(0,4), "$P$", t); tikz_format(); end(); }