The coordinates of the vertices A, B, C of the triangle are known. Write a program that calculates the area of this triangle.

program zz1;
var a, b, c, S, p, d, x1, x2, x3, y1, y2, y3: real; // set variables of non-integer type
begin
write (‘enter the coordinates of the first vertex of the triangle’);
read (x1, y1);
write (‘enter the coordinates of the second vertex of the triangle’);
read (x2, y2);
write (‘enter the coordinates of the third vertex of the triangle’);
read (x3, y3);
a: = sqrt (sqr (x1-x2) + sqr (y1-y2)); // calculate the distance between points using the formula
b: = sqrt (sqr (x1-x3) + sqr (y1-y3));
c: = sqrt (sqr (x3-x2) + sqr (y3-y2));
d: = (a + b + c) / 2; // find the semi-perimeter of the triangle
if (a + b> c) or (a + c> b) or (c + b> a) // check for the existence of a triangle, if exists, then calculate the area
then begin s: = sqrt (d * (d-a) * (d-b) * (d-c)); write (‘area of ​​triangle =’, s: 5: 2); end
else write (‘triangle does not exist’);
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.