sqrt.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "e.h"
  2. void sqrt(int p2)
  3. {
  4. static int af = 0;
  5. int nps; /* point size for radical */
  6. double radscale = 0.95;
  7. if (ttype == DEVPOST)
  8. radscale = 1.05;
  9. nps = ps * radscale * eht[p2] / EM(1.0,ps) + 0.99; /* kludgy */
  10. nps = max(EFFPS(nps), ps);
  11. yyval = p2;
  12. if (ttype == DEVCAT || ttype == DEVAPS)
  13. eht[yyval] = EM(1.2, nps);
  14. else if (ttype == DEVPOST)
  15. eht[yyval] = EM(1.15, nps);
  16. else /* DEV202, DEVPOST */
  17. eht[yyval] = EM(1.15, nps);
  18. dprintf(".\tS%d <- sqrt S%d;b=%g, h=%g, nps=%d\n",
  19. yyval, p2, ebase[yyval], eht[yyval], nps);
  20. printf(".as %d \\|\n", yyval);
  21. nrwid(p2, ps, p2);
  22. if (af++ == 0)
  23. printf(".af 10 01\n"); /* make it two digits when it prints */
  24. printf(".nr 10 %.3fu*\\n(.su/10\n", 9.2*eht[p2]); /* this nonsense */
  25. /* guesses point size corresponding to height of stuff */
  26. printf(".ds %d \\v'%gm'\\s(\\n(10", yyval, REL(ebase[p2],ps));
  27. if (ttype == DEVCAT || ttype == DEVAPS)
  28. printf("\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'", p2);
  29. else /* DEV202, DEVPOST so far */
  30. printf("\\(sr\\l'\\n(%du\\(rn'", p2);
  31. printf("\\s0\\v'%gm'\\h'-\\n(%du'\\^\\*(%d\n", REL(-ebase[p2],ps), p2, p2);
  32. lfont[yyval] = rfont[yyval] = ROM;
  33. }