Hi. I have been asked to create a function which plots a triangle given the [x,y] coordinates. then using nested or subfunctions, we have to find the circumcentre of the triangle and display the coordinates. Once we have this we then have to use another nested or subfunction to plot the circumcircle on the same plot as the triangle and find the radius of the circle.
I have managed to get the triangle to plot using 2 1x4 row vectors with the x and y coordinates of each point, but when I try to get the circumcentre i get no result and no error. Any help would be greatly appreciated. I have the following code:
function Ex7c=triang(x,y)
tri=[x;y]
hold on
plot(tri(1,:), tri(2,:))
function triinput=circumcentre(trioutput)
c=circumcentre(tri)
end
end
0 Comments
Sign in to comment.