|
//构建初始二维坐标系
CATMathPoint2D FromOrign = CATMathPoint2D(0.,0.);
CATMathVector2D FromVector2DX=CATMathVector2D(1.,0.);
CATMathVector2D FromVector2DY=CATMathVector2D(0.,1.);
CATMathAxis2D FromAxis2D=CATMathAxis2D(FromOrign,FromVector2DX,FromVector2DY);
//构建转换后二维坐标系
double uu=sqrt(1+tan(viewAngle)*tan(viewAngle));
CATMathPoint2D ToOrign = CATMathPoint2D(viewAxisX,viewAxisY);
CATMathVector2D ToVector2DX=CATMathVector2D(cos(viewAngle),sin(viewAngle));
CATMathVector2D ToVector2DY=CATMathVector2D(-sin(viewAngle),cos(viewAngle));
CATMathAxis2D ToAxis2D=CATMathAxis2D(ToOrign,ToVector2DX,ToVector2DY);
CATMathTransformation2D Transformation2D=CATMathTransformation2D(ToAxis2D,FromAxis2D);
CATMathTransformation2D Transformation2DOther=CATMathTransformation2D(FromAxis2D,ToAxis2D);
CATMathPoint2D StartPoint = CATMathPoint2D(coordS[0],coordS[1]);
CATMathPoint2D NewStartPoint = Transformation2DOther*StartPoint;
double newStartPoint[2]={NewStartPoint.GetX(),NewStartPoint.GetY()};
|
|