Witam. Jestem nowicjuszem jeżeli chodzi o język C++, dlatego proszę o pomoc. Potrzebuję stworzyć program, który sprawdzi czy 4 punkty tworzące dwie proste są do siebie prostopadłe.
Oto kawałek kodu, który udało mi się napisać:
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
class PUNKT
{
public:
int x,y,x1,y1,x2,y2,x3,y3;
PUNKT(int, int, int, int, int, int, int, int);
void wyswietl();
};
PUNKT::PUNKT(int a, int b, int a1, int b1, int a2, int b2, int a3, int b3)
{
this -> x=a;
this -> y=b;
this -> x1=a1;
this -> y1=b1;
this -> x2=a2;
this -> y2=b2;
this -> x3=a3;
this -> y3=b3;
}
void PUNKT::wyswietl()
{
gotoxy(x,y);
cout << "*";
gotoxy(x1,y1);
cout << "*";
gotoxy(x2,y2);
cout << "*";
gotoxy(x3,y3);
cout << "*";
}
class PR: public PUNKT
{
public:
int m, m1;
int prost();
};
void PR::prost();
{
m=(y1-y)/(x1-x);
m1=(y3-y2)/(x3-x2);
if((m-m1)==(-1))
cout << "tak";
}
void main()
{
int x,y,x1,y1,x2,y2,x3,y3;
cout << "x= ";
cin >> x;
cout << "y= ";
cin >> y;
cout << "x1= ";
cin >> x1;
cout << "y1= ";
cin >> y1;
cout << "x2= ";
cin >> x2;
cout << "y2= ";
cin >> y2;
cout << "x3= ";
cin >> x3;
cout << "y3= ";
cin >> y3;
clrscr();
PUNKT P(x,y,x1,y1,x2,y2,x3,y3);
P.wyswietl();
}
Proszę o wskazówki, nie rozwiązanie.