Since this is a math related function, lets make this:

```java
for (int i = 0, j = vecs.length; i < j; ++i) {
//etc
```
to avoid the length look up each time.