Let's say you have a triangle like:(adsbygoogle = window.adsbygoogle || []).push({});

1

2 3

4 5 6

7 8 9 10

The children of each element in the triangle are those directly adjacent on the next row. For example the children of 4 are 7 and 8. The children of 5 are 8 and 9.

Now let's say we flatten it to: [1,2,3,4,5,6,7,8,9,10]

Is there a way to compose a function that takes the index of the parent and returns a tuple containing the indexes of the children? (Assume 0 based indexes. The 1 through 10 are values, not indexes)

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Triangle calculation

Loading...

Similar Threads - Triangle calculation | Date |
---|---|

B What is the name of this triangular geometric shape? | Feb 20, 2018 |

B Using trig to find distance? | Jan 18, 2018 |

I Putting a point inside a triangle in 3D space | Dec 7, 2017 |

B (Proof) Two right triangles are congruent. | Jul 26, 2017 |

Alternative way to calculate the area of a right angled triangle | Dec 7, 2013 |

**Physics Forums - The Fusion of Science and Community**