예제 #1
0
        static void Main(string[] args)
        {
            Polygone p = new Polygone()
            {
                Sommets = new List <Point3d>()
                {
                    new Point3d()
                    {
                        X = -2, Y = -2, Z = 1
                    },
                    new Point3d()
                    {
                        X = 2, Y = -2, Z = 1
                    },
                    new Point3d()
                    {
                        X = 2, Y = 2, Z = 1
                    },
                    new Point3d()
                    {
                        X = -2, Y = 2, Z = 1
                    },
                }
            };

            double a = airee(p);

            affichage_forme_g(p);
            Console.Out.WriteLine($"Aire : {a}");

            Cercle c = new Cercle()
            {
                Centre = new Point3d()
                {
                    X = 1, Y = 2, Z = 3
                },
                Rayon = 1
            };

            double a2 = airee(c);

            affichage_forme_g(c);
            Console.Out.WriteLine($"Aire : {a2}");
        }
예제 #2
0
                static void Main(string[]  args)
                 {
                        Polygone p  =  new Polygone()
                                                   {
                                Sommets  =  new List <Point3d>()   {
                                        new Point3d()   {
                         X  =   - 2,  Y  =   - 2,  Z  =  1
                    },
                                        new Point3d()   {
                         X  =  2,  Y  =   - 2,  Z  =  1
                    },
                                        new Point3d()   {
                         X  =  2,  Y  =  2,  Z  =  1
                    },
                                        new Point3d()   {
                         X  =   - 2,  Y  =  2,  Z  =  1
                    },
                                    
                }
                            
            };

                        double a  =  airee(p);
                        affichage_forme_g(p);
                        Console.Out.WriteLine($"Aire : {a}");

                        Cercle c  =  new Cercle()
                                                 {
                                Centre  =  new Point3d()   {
                     X  =  1,  Y  =  2,  Z  =  3 
                },
                                Rayon  =  1
                                                     
            };

                        double a2  =  airee(c);
                        affichage_forme_g(c);
                        Console.Out.WriteLine($"Aire : {a2}");
                    
        }