,	SUBROUTINE BPROJ (JLON,JLAT,IX,IY,LPROJ,NP)HC_Titl  BPROJ conversion from lat-lon to mercator or polar-sterographic.C_Args@      	INTEGER*2 JLON(1) ![I] Longitude in units of 1/80 degree.:	INTEGER*2 JLAT(1) ![I] Latitude  in units of 1/80 degree.G	INTEGER*2 IX(1)   ![O] Location in .01 inch right from the map origin.D	INTEGER*2 IY(1)   ![O] Location in .01 inch up from the map origin.8			  !Map origin is the pole or 0 latitude, 0 longitude.E	INTEGER LPROJ	  ![I]  Projection control. - is polar; + is mercator.8C			  magnitude of  LPROJ is 1000/map_scale. e.g., for a,C			  1:25,000,000 scale map,  LPROJ = 25000/	INTEGER NP	  ![I] Number of points to convert.C_DescIC The subroutine bproj converts from latitude-longitude to a Mercator or JC to a polar-stereographic projection.  The projection uses algorithms as CC described in Map Projections used by the U.S. Geological Survey, NC Geological Survey Bulletin 1532, Snyder, John P.  This routine has explicit HC code for the size and shape of Mars.  The 1/80 of a degree is the best+C resolution in the IRTM and MAWD database.CCLCC Note: paper maps do not have an accurate scale. 84nov04, measured a paperJCC  MAP at 60 degrees latitude or delta_longitude, with following results:5CC  f = formula used to compute cartographic distance3CC  F_ = multiplier of f to get map distance = s_*sCC  C_ = projection constantC7CC  Proj  Measured   f	     f_	      scale	c_	   theoryCC>CC  M_lon   560    4800    1.1667e-1   1/25m	2.917e6   2.91467=CC  M_lat   697	 1.30794  5.32899E2   1/25m	1.332e10  1.33598ACC  Pole    533	 -.270377 1.97132e3   1/13.405 -2.643e10  2.67197LCC Output units are 0.01 inches, with maximum offset from map origin of 320 
CC inches.%C_Call vms:  SIN  COS  TAN  ALOG  ABS6C_Hist	73xxxxx  Hugh_H_Kieffer  UCLA  Original_version5C	83jan06  RMX  Adapted for  XXBIN with minor changesCC	84nov04  HHK recode, combine  BPOLAR (with correction)	and  BMERC'C	87nov15  HHK modify meaning of lproj C_EndA	DATA K180,K360/14400,28800/	! 180 and 360 degrees in input units*     &, R45/.785398/			! pi/4 =45 degrees,<     &, RINU/2.18166E-4/		! radians/input unit (1/80 degree)?     &, E,HE/.101929,.0509645/		! planet eccentricity and ecc/28	REAL*4 CLON / 2.917E6  / 	! mercator longitude constant7	REAL*4 CLAT / 1.332E10 / 	! mercator latitude constant8	REAL*4 CPOL /-2.643E10 /	! polar stereographic constant:CC	REAL*4 RADIUS /3393.4/	! mars equtorial semi-major axisCC	LOGICAL LFIRST /.TRUE./CC	IF (LFIRST) THEN0CC		UOUT = 1.E7/2.54	! 0.01 inches per kilometerCC		RU = RADIUS*UOUTCC		CLON = RU*RINU
CC		CLAT = RUCC		CPLO = -2.*RUCC		LFIRST = .FALSE.CC	    ENDIF7C	tan(x)=sin(x)/cos(x)	!  TAN function intrisic on  VAX(	IF (NP.LT.1) GO TO 9		! no points input'	SCALE = 1.E-3/FLOAT(LPROJ)	! map scale	IF (LPROJ.LT.0) GOTO 200LC------------------------------------------- mercator section --------------	FLAT = CLAT*SCALE	FLON = CLON*SCALE	DO I = 1,NP	  KLAT = JLAT(I) 	  RLAT = RINU*FLOAT(IABS(KLAT))	  ESIN = E*SIN(RLAT);	  IF (JLON(I).GT.K180) THEN	! account for central meridian		KLON = K360-JLON(I)		    ELSE		KLON = -JLON(I)
	    ENDIF	  IX(I) = FLON * KLON + 0.5	  IY(I) = 0.5 + FLAT *;     &		ALOG( TAN(R45+0.5*RLAT) * ((1-ESIN)/(1+ESIN))**HE ) 	  IF (KLAT.LT.0) IY(I) = -IY(I)	  ENDDO	GOTO 9PC----------------------------------------  POLAR  STEREOGRAPHIC  SECTION -------1C  F will be negative, to get desired orientation200	F  =  CPOL*SCALE			DO I = 1,NP	  KLAT = JLAT(I) 	  RLAT = RINU*FLOAT(IABS(KLAT))	  ESIN = E*SIN(RLAT)4	  B = F*TAN(R45-0.5*RLAT)*((1.+ESIN)/(1.-ESIN))**HE	  RLON = RINU*JLON(I)	  IX(I) = B*SIN(RLON) + .5	  IY(I) = B*COS(RLON) + .5 	  IF (KLAT.LT.0) IY(I) = -IY(I)	  ENDDO9	RETURN	END