/// <summary>
/// 计算两点间的角度
/// </summary>
/// <param name="AOrigin">原点坐标</param>
/// <param name="APoint">参考点坐标</param>
/// <param name="APoint">离心率</param>
/// <returns>返回两点间的角度</returns>
private double PointToAngle(Point AOrigin, Point APoint, double AEccentricity)
{
if (APoint.X == AOrigin.X)
if (APoint.Y > AOrigin.Y)
return Math.PI * 0.5;
else return Math.PI * 1.5;
else if (APoint.Y == AOrigin.Y)
if (APoint.X > AOrigin.X)
return 0;
else return Math.PI;
else
{
double Result = Math.Atan((AOrigin.Y - APoint.Y) /
(AOrigin.X - APoint.X) * AEccentricity);
if ((APoint.X < AOrigin.X) && (APoint.Y > AOrigin.Y))
return Result + Math.PI;
else if ((APoint.X < AOrigin.X) && (APoint.Y < AOrigin.Y))
return Result + Math.PI;
else if ((APoint.X > AOrigin.X) && (APoint.Y < AOrigin.Y))
return Result + 2 * Math.PI;
else return Result;
}
} /* PointToAngle */