ANTICHAT.XYZ    VIDEO.ANTICHAT.XYZ    НОВЫЕ СООБЩЕНИЯ    ФОРУМ  
Баннер 1   Баннер 2
Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей. Здесь обсуждаются безопасность, программирование, технологии и многое другое. Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Вернуться   Форум АНТИЧАТ > Программирование > С/С++, C#, Delphi, .NET, Asm
   
 
 
Опции темы Поиск в этой теме Опции просмотра

Решение уравнений методом Крамера [c#]
  #1  
Старый 17.10.2007, 10:47
[x26]VOLAND
Moderator - Level 7
Регистрация: 07.06.2006
Сообщений: 556
Провел на форуме:
7549607

Репутация: 2702


Отправить сообщение для [x26]VOLAND с помощью ICQ Отправить сообщение для [x26]VOLAND с помощью AIM
По умолчанию Решение уравнений методом Крамера [c#]

http://www.voland-lab.com/files/other/KramerMax.exe
Может кому надо....
Сорс:
PHP код:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 
KramerMax
{
    public 
partial class Form1 Form
    
{
        public 
Form1()
        {
          
InitializeComponent();
        }

        
float def(float[,] a//находим определитель
        
{
            
float def;
            
def a[1,1]*a[2,2]*a[3,3] + a[1,2]*a[2,3]*a[3,1] + a[2,1]*a[3,2]*a[1,3] - a[1,3]*a[2,2]*a[3,1] - a[1,2]*a[2,1]*a[3,3] - a[1,1]*a[2,3]*a[3,2];
            return 
def;
        }
        
        private 
void button1_Click(object senderEventArgs e)
        {
            
xt.Text "";
            
yt.Text "";
            
zt.Text "";
            
tssl.Text "";

            if (
a11.Text == "" || a12.Text == "" || a13.Text == "" || a21.Text == "" || a22.Text == "" || a23.Text == "" || a31.Text == "" || a32.Text == "" || a33.Text == "")
            {
                
tssl.Text "Введены не все коэффициенты";
            }
            else
            {
                
float[,] = new float[44];
                
a[11] = float.Parse(a11.Text);
                
a[12] = float.Parse(a12.Text);
                
a[13] = float.Parse(a13.Text);
                
a[21] = float.Parse(a21.Text);
                
a[22] = float.Parse(a22.Text);
                
a[23] = float.Parse(a23.Text);
                
a[31] = float.Parse(a31.Text);
                
a[32] = float.Parse(a32.Text);
                
a[33] = float.Parse(a33.Text);
                
deftxt.Text def(a).ToString();
            }
        }

        private 
void button2_Click(object senderEventArgs e)
        {
            
tssl.Text "";

            if (
a11.Text == "" || a12.Text == "" || a13.Text == "" || a21.Text == "" || a22.Text == "" || a23.Text == "" || a31.Text == "" || a32.Text == "" || a33.Text == "" || b1.Text == "" || b2.Text == "" || b3.Text == "")
            {
                
tssl.Text "Введены не все элементы уравнения";
            }
            else
            {
                
float[,] = new float[44];
                
A[11] = float.Parse(a11.Text);
                
A[12] = float.Parse(a12.Text);
                
A[13] = float.Parse(a13.Text);
                
A[21] = float.Parse(a21.Text);
                
A[22] = float.Parse(a22.Text);
                
A[23] = float.Parse(a23.Text);
                
A[31] = float.Parse(a31.Text);
                
A[32] = float.Parse(a32.Text);
                
A[33] = float.Parse(a33.Text);
                
float D def(A);
                
deftxt.Text D.ToString();

                
float[,] = new float[44];
                
a[11] = float.Parse(b1.Text);
                
a[12] = float.Parse(a12.Text);
                
a[13] = float.Parse(a13.Text);
                
a[21] = float.Parse(b2.Text);
                
a[22] = float.Parse(a22.Text);
                
a[23] = float.Parse(a23.Text);
                
a[31] = float.Parse(b3.Text);
                
a[32] = float.Parse(a32.Text);
                
a[33] = float.Parse(a33.Text);
                
float Dx def(a);

                
float[,] = new float[44];
                
b[11] = float.Parse(a11.Text);
                
b[12] = float.Parse(b1.Text);
                
b[13] = float.Parse(a13.Text);
                
b[21] = float.Parse(a21.Text);
                
b[22] = float.Parse(b2.Text);
                
b[23] = float.Parse(a23.Text);
                
b[31] = float.Parse(a31.Text);
                
b[32] = float.Parse(b3.Text);
                
b[33] = float.Parse(a33.Text);
                
float Dy def(b);

                
float[,] = new float[44];
                
c[11] = float.Parse(a11.Text);
                
c[12] = float.Parse(a12.Text);
                
c[13] = float.Parse(b1.Text);
                
c[21] = float.Parse(a21.Text);
                
c[22] = float.Parse(a22.Text);
                
c[23] = float.Parse(b2.Text);
                
c[31] = float.Parse(a31.Text);
                
c[32] = float.Parse(a32.Text);
                
c[33] = float.Parse(b3.Text);
                
float Dz def(c);

                
float xyz;
                
Dx D;
                
Dy D;
                
Dz D;

                
xt.Text x.ToString();
                
yt.Text y.ToString();
                
zt.Text z.ToString();
            }
        }
    }

 
Ответить с цитированием
 





Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT.XYZ