Message Boards Message Boards

0
|
3010 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Get coordinate of vertices of each triangle?

Posted 8 years ago

Hi All, Assume that I have the figure below and I know coordinates of each point. How can I get coordinate of vertices of each triangle? For example

T1={{0,0},{1,0},{1,1}} ,T2={{0,0},{0,1},{1,1}} 

and so on. Thanks in advance.. enter image description here

n = 2;

pts = Flatten[Table[{i, j}, {j, 0, n}, {i, 0, n}], 1]

{{0, 0}, {1, 0}, {2, 0}, {0, 1}, {1, 1}, {2, 1}, {0, 2}, {1, 2}, {2,  2}}

ListPlot[Labeled[#, #] & /@ pts, Axes -> False]
POSTED BY: Okkes Dulgerci
Posted 8 years ago

I found this solution but if you have fancy one I can look at that too.

lowerRight = Drop[Table[{{i, j}, {i + 1, j}, {i + 1, j + 1}}, {j, 0, n}, {i, 0,  n}], -1, -1]
upperLeft = Drop[Table[{{i, j}, {i, j + 1}, {i + 1, j + 1}}, {j, 0, n}, {i, 0,  n}], -1, -1]
POSTED BY: Okkes Dulgerci
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract