Esempio n. 1
0
 public Point(double par1, double par2, PointRepresentation pr)
 {
     if (pr == PointRepresentation.Polar)
     {
         r = par1; a = par2;
     }
     else
     {
         r = RadiusGivenXy(par1, par2);
         a = AngleGivenXy(par1, par2);
     }
 }
Esempio n. 2
0
 public Point(PointRepresentation rep, double val1, double val2)
 {
     if (rep == PointRepresentation.Rectengular)
     {
         this.R = ConvToR(val1, val2);
         this.A = ConvToA(val1, val2);
     }
     else
     {
         this.R = val1;
         this.A = val2;
     }
 }
Esempio n. 3
0
 public Point(double par1, double par2, PointRepresentation pr)
 {
     if (pr == PointRepresentation.Polar)
     {
         _radius = par1;
         _angle  = par2;
     }
     else
     {
         _radius = GetRadiusXy(par1, par2);
         _angle  = GetAngleXy(par1, par2);
     }
 }
Esempio n. 4
0
 public Point(PointRepresentation represenation, double rValue, double AValues)
 {
     if (represenation != PointRepresentation.Rectangular)
     {
         r = rValue;
         A = AValues;
     }
     else
     {
         r = Math.Sqrt(Math.Pow(rValue, 2) + Math.Pow(AValues, 2));
         A = Math.Atan2(AValues, rValue);
     }
 }
Esempio n. 5
0
 public Point(PointRepresentation represenation, double firstValue, double secondValue)
 {
     if (represenation == PointRepresentation.Rectangular)
     {
         this.r = Math.Sqrt(Math.Pow(firstValue, 2) + Math.Pow(secondValue, 2));
         this.A = Math.Atan2(secondValue, firstValue);
     }
     else
     {
         this.r = firstValue;
         this.A = secondValue;
     }
 }
Esempio n. 6
0
        // Constructorul cu cei 3 parametri
        public Point(PointRepresentation pr, double a, double b)
        {
            if (pr == PointRepresentation.Polar)
            {
                raza    = a;
                unghiul = b;
            }

            if (pr == PointRepresentation.Rectangular)
            {
                raza    = RadiusR(a, b);
                unghiul = AngleA(a, b);
            }
        }
Esempio n. 7
0
        public Point(PointRepresentation p, double a, double b)
        {
            if (p == PointRepresentation.Polar)
            {
                radius = a;
                angle  = b;
            }

            if (p == PointRepresentation.Rectangular)
            {
                radius = RadiusXY(a, b);
                angle  = AngleXY(a, b);
            }
        }
Esempio n. 8
0
 // tipul de reprezentare este cel polar
 // constructor
 public Point(PointRepresentation pr, double n1, double n2)
 {
     if (pr == PointRepresentation.Polar)
     {
         radius = n1; angle = n2;
     }
     else if (pr == PointRepresentation.Rectangular)
     {
         radius = RadiusGivenXy(n1, n2);
         angle  = AngleGivenXy(n1, n2);
     }
     else
     {
         throw new Exception("Situație imprevizibilă!");
     }
 }
Esempio n. 9
0
 public Point(PointRepresentation pr, float a_r, float b_A)
 {
     if (pr == PointRepresentation.Polar)
     {
         _r = a_r;
         _A = b_A;
         _a = Get_a();
         _b = Get_b();
     }
     if (pr == PointRepresentation.Rectangular)
     {
         _a = a_r;
         _b = b_A;
         _r = Get_r();
         _A = Get_A();
     }
 }
Esempio n. 10
0
 public Point(PointRepresentation pr, float ar, float bA)
 {
     if (pr == PointRepresentation.Polar)
     {
         rr = ar;
         AA = bA;
         aa = aGet();
         bb = bGet();
     }
     if (pr == PointRepresentation.Rectangular)
     {
         aa = ar;
         bb = bA;
         rr = rGet();
         AA = AGet();
     }
 }
Esempio n. 11
0
 public Point(PointRepresentation pr, float ar, float bA)
 {
     if (pr == PointRepresentation.Polar)
     {
         ad = ar;
         AF = bA;
         ab = aGet();
         ac = bGet();
     }
     if (pr == PointRepresentation.Rectangular)
     {
         ab = ar;
         ac = bA;
         ad = rGet();
         AF = AGet();
     }
 }
Esempio n. 12
0
 public void UpdateAngularRepresentation(Point centroid)
 {
     DistanceFromCentroid    = PointRepresentation.DistanceTo(centroid);
     AngleRelativeToCentroid = Angle.FromRadians(Math.Atan2(Y, X));
 }