Beispiel #1
0
        private void MoveOnRadiusChange()
        {
            GeneralLineForm startLine   = new GeneralLineForm(OrbitBase.ObjectPosition, this.StartPosition);
            GeneralLineForm currectLine = new GeneralLineForm(OrbitBase.ObjectPosition, ObjectPosition);

            int isDown = -1;

            if (ObjectPosition.Y > OrbitBase.ObjectPosition.Y)
            {
                isDown = 1;
            }

            double currectAngle = startLine.GetAngle(currectLine);

            ObjectPosition = this.StartPosition;
            MoveByAngle(currectAngle * isDown);
        }
        public double GetAngle(GeneralLineForm line)
        {
            double angle = (A * line.A + B * line.B) / (Math.Sqrt(Math.Pow(A, 2) + Math.Pow(B, 2)) * Math.Sqrt(Math.Pow(line.A, 2) + Math.Pow(line.B, 2)));

            return(Math.Acos(angle) / Math.PI * 180);
        }