Example #1
0
        public void Transform(Transformation trans)
        {
            Transformation.SingularValueDecompositoin svd = trans.SingularValueDecomposition;

            if (svd.Scale[0] == svd.Scale[1])
            {
                Center = trans[Center];
                Size   = new SizeF
                {
                    Height = svd.Scale[0] * Size.Height,
                    Width  = svd.Scale[1] * Size.Width
                };
                Radius = Size.Height / 2;
            }
            else
            {
                throw new NotImplementedException("Коэффициенты масштабирования круга по осям не равны");
            }
        }
Example #2
0
        public void Transform(Transformation trans)
        {
            Transformation.SingularValueDecompositoin svd = trans.SingularValueDecomposition;
            var tolerance = Math.Pow(10, -7) * 5;

            if (Math.Abs(svd.Scale[0] - svd.Scale[1]) < tolerance)
            {
                Center = trans[Center];
                Size   = new SizeF
                {
                    Height = svd.Scale[0] * Size.Height,
                    Width  = svd.Scale[1] * Size.Width
                };
                RotateAngle += svd.FirstAngle;
            }
            else
            {
                throw new NotImplementedException("Коэффициенты масштабирования элипса по осям не равны");
            }
        }