From: Faisal Ahmed on
I have some co-ordinates and I have drawn a network with lines using "line" function. so there are some lines, some triangles, some quadrilaterals etc. is there any way in MATLAB that can automatically tell me only how many triangles are there and what are their vertices? tha'd be a life saver. thank you.
From: us on
"Faisal Ahmed" <fap87(a)yahoo.com> wrote in message <i3du01$maa$1(a)fred.mathworks.com>...
> I have some co-ordinates and I have drawn a network with lines using "line" function. so there are some lines, some triangles, some quadrilaterals etc. is there any way in MATLAB that can automatically tell me only how many triangles are there and what are their vertices? tha'd be a life saver. thank you.

show CSSM a small example written in ML language...

us
From: Walter Roberson on
Faisal Ahmed wrote:
> I have some co-ordinates and I have drawn a network with lines using
> "line" function. so there are some lines, some triangles, some
> quadrilaterals etc. is there any way in MATLAB that can automatically
> tell me only how many triangles are there and what are their vertices?
> tha'd be a life saver. thank you.

No there isn't.

Question: suppose the network of intersecting lines is such that I have
a theoretical quadrilateral but one side of it is sufficiently small
that the rendered version of it has two of the vertices at the same
pixel, thus making it _appear_ to be a triangle. Which should it be
counted as, triangle or quad?
From: ImageAnalyst on
It's kind of kludgy but it might work. What if he saved the diagram
as an image, then did a hole fill (to get solid triangles), then did
bwlabel and regionprops to get info on the objects, and filtered them
based on their shape to get just the triangular objects?
From: Doug Hull on
Post an example with an annotated version showing what you consider the correct answer.

Imagine an equilateral triangle with a line bisecting it through one vertex. Is that two triangles, or three counting the big one?

Imagine same equilateral triangle with a line bisecting in through one vertex and another line at another vertex bisecting also. These lines cross in the middle. How many here? Eight?

Doug