How to modify loop

1 visualizzazione (ultimi 30 giorni)
Robert Smith
Robert Smith il 8 Set 2017
Modificato: Robert Smith il 8 Set 2017
I'm attempting to modify code to loop
  1 Commento
José-Luis
José-Luis il 8 Set 2017
Modificato: José-Luis il 8 Set 2017
How does the code you show help you with your objective? It is not Matlab syntax.

Accedi per commentare.

Risposte (1)

Roger Stafford
Roger Stafford il 8 Set 2017
There is no single matlab function that will calculate it, but you can
make use of the geometrical theorem that the radius of a circumscribing
circle of a triangle is equal to the product of its three sides divided by
four times the triangle's area.
a = sqrt((x1-x2)^2+(y1-y2)^2); % The three sides
b = sqrt((x2-x3)^2+(y2-y3)^2);
c = sqrt((x3-x1)^2+(y3-y1)^2);
s = (a+b+c)/2;
A = sqrt(s*(s-a)*(s-b)*(s-c)); % Area of triangle
R = a*b*c/(4*A); % Radius of circumscribing circle

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by