コード例 #1
0
        public void GetAngleOffsets(HorizontalCoordinate objectCoord, ref Angle horzAngle, ref Angle vertAngle)
        {
            Vector3 objectVector    = objectCoord.ToVector();
            Vector3 horzObjectCross = Vector3.Cross(objectVector, -horzAxis);
            Vector3 vertObjectCross = Vector3.Cross(objectVector, vertAxis);

            horzObjectCross.Normalize();
            vertObjectCross.Normalize();

            double x = Vector3.Dot(horzObjectCross, vertAxis);
            double y = Vector3.Dot(horzObjectCross, this.ViewCenterVector);

            horzAngle = -Angle.ArcTangent(y, x);

            x = Vector3.Dot(vertObjectCross, horzAxis);
            y = Vector3.Dot(vertObjectCross, this.ViewCenterVector);

            vertAngle = -Angle.ArcTangent(y, x);
        }