integral.c 774 B

123456789101112131415161718192021222324252627282930
  1. #include "e.h"
  2. #include "y.tab.h"
  3. extern int Intps;
  4. extern double Intht, Intbase, Int1h, Int1v, Int2h, Int2v;
  5. void integral(int p, int p1, int p2)
  6. {
  7. if (p1 != 0)
  8. printf(".ds %d \\h'%gm'\\v'%gm'\\*(%d\\v'%gm'\n", p1, -Int1h, Int1v, p1, -Int1v);
  9. if (p2 != 0)
  10. printf(".ds %d \\v'%gm'\\h'%gm'\\*(%d\\v'%gm'\n", p2, -Int2v, Int2h, p2, Int2v);
  11. if (p1 != 0 && p2 != 0)
  12. shift2(p, p1, p2);
  13. else if (p1 != 0)
  14. bshiftb(p, SUB, p1);
  15. else if (p2 != 0)
  16. bshiftb(p, SUP, p2);
  17. dprintf(".\tintegral: S%d; h=%g b=%g\n", p, eht[p], ebase[p]);
  18. lfont[p] = ROM;
  19. }
  20. void setintegral(void)
  21. {
  22. yyval = salloc();
  23. printf(".ds %d %s\n", yyval, lookup(deftbl, "int_def")->cval);
  24. eht[yyval] = EM(Intht, ps+Intps);
  25. ebase[yyval] = EM(Intbase, ps);
  26. lfont[yyval] = rfont[yyval] = ROM;
  27. }