Exemplo n.º 1
0
		public Polynome Dérivée () {
			var poly = new Polynome ();
			for (int k = 1; k <= Degré; k++) {
				poly.AddCoefficient (k - 1, k * GetCoefficient (k));
			}
			return poly;
		}
Exemplo n.º 2
0
		public static Polynome operator /(Polynome A, Polynome B) {
			var Q = new Polynome ();

			while (A.Degré >= B.Degré) {
				var C = new Polynome ();
				C.AddCoefficient ((A.Degré - B.Degré) * Convert.ToInt32(A.Degré >= B.Degré), A.GetCoefficient (A.Degré) / B.GetCoefficient (B.Degré));
				A -= B * C;
				Q += C;
			}

			return Q;
		}
Exemplo n.º 3
0
		public static Polynome operator *(Polynome A, Polynome B) {
			var poly = new Polynome ();

			for (int k = 0; k <= A.Degré; k++) {
				for (int l = 0; l <= B.Degré; l++) {
					poly.AddCoefficient (k+l, A.GetCoefficient (k) * B.GetCoefficient (l));
				}
			}
			return poly;
		}
Exemplo n.º 4
0
		public static Polynome operator -(Polynome A, Polynome B) {
			var poly = new Polynome ();

			for (int k = 0; k <= Math.Max(A.Degré, B.Degré); k++) {
				poly.AddCoefficient (k, A.GetCoefficient(k)-B.GetCoefficient(k));
			}
			return poly;
		}