.Using Matlab:
Find the average area of 1000 triangles whose vertices are given by v(k) = 10(rand() + j rand()) for k=1,2, and 3, in the complex plane. Some of the vertices of the triangles may be co-linear giving a zero area. Use as the first line the command rng(829) to seed the random number generator. Put the average area in the title of a plot in which there is only the last one of the triangles drawn. You may find it useful to set the axes by using axis([0,10,0,10]).
rng(829);
for m=1:1000
for n=1:3
v(n)=10*(rand()+i*rand());
end
a=abs(v(1)-v(2));
b=abs(v(2)-v(3));
c=abs(v(2)-v(3));
s = (a+b+c)/2;
area(m) = sqrt(s*(s-a)*(s-b)*(s-c));
end
hold on
plot([real(v(1)) real(v(2))], [imag(v(1)) imag(v(2))]);
plot([real(v(2)) real(v(2)+v(3))], [imag(v(2))
imag(v(2)+v(3))]);
plot([real(v(2)+v(3)) real(v(1))], [imag(v(2)+v(3))
imag(v(1))]);
average=mean(area);
title(sprintf('mean area of triangle is', average))

.Using Matlab: Find the average area of 1000 triangles whose vertices are given by v(k) =...