pro pole_axis, para_in,region,x_region,y_region,para_out


pi=3.1415926526
hpi=pi/2.
p=para_in(0)*pi/180.
b0=para_in(1)*pi/180.
xd=fix(para_in(2))
yd=fix(para_in(3))
xcen=para_in(4)
ycen=para_in(5)
r=para_in(6)
r2=r*r

tmp=bytarr(xd,yd)
for i=0, xd-1 do begin
limit=sqrt(r2-float(i-xcen)*float(i-xcen))+ycen
tmp(i,0:limit-1)=1
endfor
region=where(tmp eq 1)
yy=region/xd
xx=region-yy*xd
yy0=float(xx)-xcen
zz0=float(yy)-ycen
xx0=sqrt(r2-yy0*yy0-zz0*zz0)

coorcoe,p,b0,matrix,1

x_region=fix(xx0*matrix(1,0)+yy0*matrix(1,1)+zz0*matrix(1,2))
y_region=fix(xx0*matrix(2,0)+yy0*matrix(2,1)+zz0*matrix(2,2))
x_max=max(x_region,min=x_min)
y_max=max(y_region,min=y_min)

para_out=intarr(4)
para_out(0)=x_max-x_min+1	;dimension in X-direction
para_out(1)=y_max-y_min+1	;dimension in y-direction
para_out(2)=-x_min		;center in X-direction
para_out(3)=-y_min		;center in Y-direction
x_region=x_region-x_min
y_region=y_region-y_min

end
