Difference between revisions of "LIST STAT SUM SQUARES"
Jump to navigation
Jump to search
m |
m (<lsl> tag to <source>) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
|type=integer | |type=integer | ||
|value=7 | |value=7 | ||
|desc=Calculates the sum of the squares of the numbers in a list. That is, for each number ''N_i'' in a list of ''k'' elements, it calculates ''N_1*N_1 + N_2*N_2 + ... + N_k * N_k''. | |desc=Calculates the sum of the squares of the numbers in a list. | ||
<source lang="lsl2"> | |||
float sum_of_squares = llListStatistics( LIST_STAT_SUM_SQUARES, numList ); | |||
</source> | |||
That is, for each number ''N_i'' in a list of ''k'' elements, it calculates ''N_1*N_1 + N_2*N_2 + ... + N_k * N_k''. | |||
|pa= | |pa= | ||
|text= | |text= |
Latest revision as of 16:01, 23 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer LIST_STAT_SUM_SQUARES = 7;The integer constant LIST_STAT_SUM_SQUARES has the value 7
Calculates the sum of the squares of the numbers in a list.
float sum_of_squares = llListStatistics( LIST_STAT_SUM_SQUARES, numList );
That is, for each number N_i in a list of k elements, it calculates N_1*N_1 + N_2*N_2 + ... + N_k * N_k.
Caveats
Related Articles
Functions
• | llListStatistics |