How to find the vertices of a trinagle given points on the triangle?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have been given 6 points where 2 points define a side of the trianglee. how can I obtain the vertices of triangle?
0 Kommentare
Antworten (2)
Matt J
am 28 Mai 2014
Meaning the 6 points consist of duplicates of the vertices? If so, this looks applicable
5 Kommentare
Matt J
am 28 Mai 2014
Bearbeitet: Matt J
am 28 Mai 2014
If S is a 6x2 matrix such that each pair of consecutive rows S(i,:) and S(i+1,:) are points on one side of the triangle, then you can use qlcon2vert ( Available Here ) as follows,
x0=mean(S).'; %interior point
A=[S(2,:)-S(1,:); S(4,:)-S(3,:); S(6,:)-S(5,:)]*[0 -1; 1 0];
b=sum(A.*S(1:2:end,:),2);
D=diag(sign(b-A*x0));
A=D*A; b=D*b;
Vertices=qlcon2vert(x0,A,b)
3 Kommentare
Matt J
am 28 Mai 2014
I cannot read it. To use the
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/178949/image.png)
button properly, highlight the code first and then click the button.
Siehe auch
Kategorien
Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!