Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses CRT,DOS;
- var x1,x2,x3,y1,y2,y3:real;
- A,B,C:real;
- D,E,F:Single;
- begin
- clrscr;
- x1 := 0;
- y1 := -5;
- x2 := 10;
- y2 := 0;
- x3 := 10;
- y3 := 5;
- A := sqrt( sqr(x1-x2) + sqr(y1-y2) );
- B := sqrt( sqr(x2-x3) + sqr(y2-y3) );
- C := sqrt( sqr(x3-y1) + sqr(y3-y1) );
- if not ((A + B <= C) or (A + C <= B) or (B + C <= A)) then
- begin
- writeln('Ne treugolnik');
- ReadKey;
- exit;
- end;
- D := (x1-0) * (y2-y1) - (x2-x1) * (y1-0);
- E := (x2-0) * (y3-y2) - (x3-x2) * (y2-0);
- F := (x3-0) * (y1-y3) - (x1-x3) * (y3-0);
- if (((D >= 0) and (E >= 0) and (F >= 0)) or ((D <= 0) and (E <= 0) and (F <= 0))) then
- begin
- writeln('Nachalo koordinat prinadleshit treugolniku');
- end
- else
- begin
- writeln('Nachalo koordinat ne prinadleshit treugolniku');
- end;
- ReadKey;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement