这段程序原理算法是什么
nt CMy1View::drawPoint(float m, float n, float k){
int a=30,b=105;
double Z,A,x,y;
int x0,y0;
Z=acos(sin(m*Pi/180)*sin(a*Pi/180)+cos(m*Pi/180)*cos(a*Pi/180)*cos(n*Pi/180-b*Pi/180));
if(sin(Z)==0)A=0;
else A=asin(cos(m*Pi/180)*sin(n*Pi/180-b*Pi/180)/sin(Z));
if(m<a)x=-(R*Z*cos(A))/BLC;
else x=R*Z*cos(A)/BLC;
y=R*Z*sin(A)/BLC;
if(m==25&&(n==55||n==145)) x=-x;
if(k==0)return y0=int(zy-1000*x);
if(k==1)return x0=int(1000*y+sx);
}
void CMy1View::LineClip(float x1, float y1, float x2, float y2)
{
CDC *pDC=GetDC();
GetCurrentPen();
CPen pen;
pen.CreatePen(i,j,RGB(0,0,0));
pDC->SelectObject(pen);
float dx,dy,u1,u2;
XL=drawPoint(12,80,1);
XR=drawPoint(55,144,1);
YT=drawPoint(12,80,0);
YB=drawPoint(55,144,0);
u1=0;
u2=1;
dx=x2-x1;
dy=y2-y1;
if(Clip(-dx,x1-XL,&u1,&u2))
if(Clip(dx,XR-x1,&u1,&u2))
if(Clip(-dy,y1-YB,&u1,&u2))
if(Clip(dy,YT-y1,&u1,&u2))
{
pDC->MoveTo(x1+u1*dx,y1+u1*dy);
pDC->LineTo(x1+u2*dx,y1+u2*dy);
}
ReleaseDC(pDC);
}
bool CMy1View::Clip(float p, float q, float *u1, float *u2)
{
float r;
if(p<0)
{
r=q/p;
if(r>*u2)
return false;
if(r>*u1)
*u1=r;
}
else if(p>0)
{
r=q/p;
if(r<*u1)
return false;
if(r<*u2)
*u2=r;
}
else return (q>=0);
return true;
}