![]() |
|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
![]() |
|
Опции темы | Поиск в этой теме |
![]() |
#1 |
Регистрация: 06.06.2013
Сообщений: 7
|
![]()
Добрый день.
Помогите с программой в С++,тема Векторная Арифметика, нужна визуалка, есть пример в консоле! помогите переделать или подскажите кто что знает.. //#include <vcl.h> #include <conio.h> #include <iostream.h> #pragma hdrstop #pragma argsused class vect { public: vect(int=0,int=0,int=0); // koHCTpykTop vect operator+(const vect &) const; // c/|o}|{eHue vect operator-(const vect &) const; // BbI4uTaHue vect operator*(const vect &); // cka/|5IpHoe npou3BegeHue vect operator*(const int &); // YMHo}|{eHue BekTopa Ha 4uc/|o void print() const; // ne4aTb private: int x,y,z; }; class vec { public: vec(int=0,int=0,int=0); vec operator-(const vec &) const; void print() const; private: int x,y,z; }; vec::vec(int x1,int y1, int z1) { x = x1; y = y1; z = z1; } // KoHCTpykTop: vect::vect(int x1,int y1,int z1) { x = x1; y = y1; z = z1; } // c/|o}|{eHue: vect vect: ![]() { vect sum; sum.x = x + operand2.x; sum.y = y + operand2.y; sum.z = z + operand2.z; return sum; } // BbI4uTaHue: vect vect: ![]() { vect diff; diff.x = x - operand2.x; diff.y = y - operand2.y; diff.z = z - operand2.z; return diff; } // cka/|5IPHoe npou3BegeHue: vect vect: ![]() { vect proizv; proizv.x = x * operand2.x; proizv.y = y * operand2.y; proizv.z = z * operand2.z; return proizv; } // YMHo}|{eHue BekTopa Ha 4uc/|o: vect vect: ![]() { vect proizv; proizv.x = x * operand2; proizv.y = y * operand2; proizv.z = z * operand2; return proizv; } // BekTopHoe npou3BegeHue: vec vec: ![]() { vec proizv; proizv.x = y * operand2.z - z * operand2.y; proizv.y = z * operand2.x - x * operand2.x; proizv.z = x * operand2.y - y * operand2.x; return proizv; } // ne4aTb o6bekTa B Buge (x,y,z): void vect:rint() const { cout«'('«x«", "«y«", "«z«')'; } void vec:rint() const { cout«'('«x«", "«y«", "«z«')'; } int main(int argc, char* argv[]) { vect x(5,6,7),y(4,3,2); vect z; int chislo = 8; cout«"\n Vector 1: "; x.print(); cout«"\n Vector 2: "; y.print(); z = x + y; cout«"\n Slozhenie: "; z.print(); z = x - y; cout«"\n Vichitanie: "; z.print(); z = x * y; cout«"\n Skalyarnoe proizvedenie: "; z.print(); z = x * chislo; cout«"\n YmnozhenieV1 na chislo: "; z.print(); z = y * chislo; cout«"\n YmnozhenieV2 na chislo: "; z.print(); z = x - y; cout«"\n Vectornoe proizvedenie: "; z.print(); getch(); return 0; } |
![]() |
![]() |
![]() |
![]() |
||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Векторная алгебра | ACE Valery | Помощь студентам | 55 | 13.02.2014 23:18 |
C++ Векторная Арифметика | Артем_начинашка | Помощь студентам | 6 | 06.06.2013 12:43 |
векторная алгебра | KIRILOW | Помощь студентам | 61 | 31.10.2012 15:45 |
Векторная графика | AnReykfi | Помощь студентам | 0 | 15.05.2010 14:10 |
векторная графика. квадрат | varelik | Мультимедиа в Delphi | 18 | 07.09.2009 22:25 |