예제 #1
0
		public Punto3D ObtenerPunto(double X)
		{
			Ecuacion ec1 = null;
			Ecuacion ec2 = null;
			SistemaEcuaciones sis = null;

			ec1 = new Ecuacion(PlanoA.B, PlanoA.C, -(PlanoA.D + (PlanoA.A * X)));
			ec2 = new Ecuacion(PlanoB.B, PlanoB.C, -(PlanoB.D + (PlanoB.A * X)));

			sis = new SistemaEcuaciones(ec1, ec2);

			if (sis.Solucion.TipoSolucion == TipoSolucionSistema.SistemaCompatibleDeterminado) {
				return new Punto3D(X, sis.Solucion.ValorSolucion[0], sis.Solucion.ValorSolucion[1]);
			} else {
				throw new ExcepcionGeometrica3D("RECTA3D (OBTENERPUNTO): No se ha podido calcular el punto. Es posible que los datos de los planos sean erroneos, o que el cálculo del sistema halla fallado." + Constants.vbNewLine + "Valor de la variable=" + X.ToString() + Constants.vbNewLine + "Primer plano: " + PlanoA.ToString() + Constants.vbNewLine + "Seundo plano: " + PlanoB.ToString() + Constants.vbNewLine + "Primera ecuación del sistema: " + ec1.ToString() + Constants.vbNewLine + "Segunda ecuación del sistema: " + ec2.ToString() + Constants.vbNewLine + "Solución obtenida: " + sis.Solucion.ToString());
			}
		}
예제 #2
0
		public static Ecuacion Copia(Ecuacion Ecuacion)
		{
			return new Ecuacion(Ecuacion.Variables);
		}