Beispiel #1
0
        public Figure Deformation(int coeffH, int coeffV)
        {
            Figure f;

            if (coeffH * largeur != coeffV * hauteur)
            {
                if (coeffH * largeur > coeffV * hauteur)
                {
                    f = new Rectangle(posX, posY, coeffV * hauteur, coeffH * largeur);
                }
                else
                {
                    f = new Rectangle(posX, posY, coeffH * largeur, coeffV * hauteur);
                }
            }
            else
            {
                f = new Carre(posX, posY, coeffH * largeur);
            }
            return(f);
        }
Beispiel #2
0
        public Figure Deformation(int coeffH, int coeffV)
        {
            Figure f;

            if (coeffH == coeffV)
            {
                f = new Carre(posX, posY, longueur * coeffH);
            }
            else
            {
                if (coeffV > coeffH)
                {
                    f = new Rectangle(posX, posY, coeffH * longueur, coeffV * longueur);
                }
                else
                {
                    f = new Rectangle(posX, posY, coeffV * longueur, coeffH * longueur);
                }
            }
            return(f);
        }