home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8710 / 14 / centch.f < prev    next >
Encoding:
Text File  |  1990-07-13  |  923 b   |  35 lines

  1.         subroutine centch(x,y,ang,ht,xx,yy)
  2. c **** Calculate coords of bottom left of char cell
  3. c Input:
  4. c        x,y = coords of center of char cell
  5. c        ang, ht = angle (degrees) and height (inches) of cell
  6.  
  7. c Output:
  8. c        xx,yy = coords of bottom, left corner
  9.  
  10. c ---- Set x,y shift factors for Unix/houston:
  11.           parameter (xadj=0.3333, yadj=0.5000)
  12.  
  13. c ---- See if x or y indicate `use last coordinate':
  14.       if (abs(x-999.) - 0.1  .lt. 0.) then
  15.         call where(xlast, ylast, rfact)
  16.         xloc = xlast
  17.       else
  18.             xloc = x
  19.       end if
  20.       if (abs(y-999.) - 0.1  .lt. 0.) then
  21.         call where(xlast, ylast, rfact)
  22.         yloc = ylast
  23.       else
  24.             yloc = y
  25.       end if
  26.  
  27. c ---- Calculate bottom left corner from center. ----
  28.       rang = .0174533 * ang
  29.       cosa = cos (rang)
  30.       sina = sin (rang)
  31.       xx = xloc - ht*cosa*xadj + yadj*ht*sina
  32.       yy = yloc - ht*sina*xadj - yadj*ht*cosa
  33.         return
  34.         end
  35.