mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
add m_cumulate
This commit is contained in:
10
src/m_cumulate.scad
Normal file
10
src/m_cumulate.scad
Normal file
@@ -0,0 +1,10 @@
|
||||
include <__private__/__m_multiply.scad>;
|
||||
|
||||
function _m_cumulate(matrice, i) =
|
||||
i == len(matrice) - 2 ?
|
||||
__m_multiply(matrice[i], matrice[i + 1]) :
|
||||
__m_multiply(matrice[i], _m_cumulate(matrice, i + 1));
|
||||
|
||||
function m_cumulate(matrice) =
|
||||
len(matrice) == 1 ? matrice[0] : _m_cumulate(matrice, 0);
|
||||
|
Reference in New Issue
Block a user