Stores the coordinates of the vertices of the triangles
let n = rectangle . length ; let triangle1 = [ ] ; for ( let i = 1 ; i < n ; i ++ ) triangle1 . push ( rectangle [ i ] ) ; let triangle2 = [ ] ; for ( let i = 0 ; i < 3 ; i ++ ) { triangle2 . push ( rectangle [ i ] ) ; } let triangle3 = [ ] ; for ( let i = 0 ; i < 2 ; i ++ ) { triangle3 . push ( rectangle [ i ] ) ; } triangle3 . push ( rectangle [ 3 ] ) ; let triangle4 = [ ] ; for ( let i = n - 2 ; i < n ; i ++ ) { triangle4 . push ( rectangle [ i ] ) ; } triangle4 . push ( rectangle [ 0 ] ) ;