How to use 'split in angular' in JavaScript

Every line of 'split in angular' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
167function split(i) {
168 if (N >= N_MAX || ballk[i] < 50) { return; }
169 ballk[i] /= 2;
170
171 var dv = [ ballv[i][1], -ballv[i][0] ];
172 var vmag = Math.sqrt(dv[1]*dv[1]+dv[0]*dv[0])/2;
173 dv[0] /= vmag; dv[1] /= vmag;
174
175
176 ballk[N] = ballk[i];
177 ballq[N] = [ ballq[i][0], ballq[i][1] ];
178 ballv[N] = [ (ballv[i][0]-dv[0])*.9, (ballv[i][1]-dv[1])*.9 ];
179
180 ballv[i] = [(ballv[i][0]+dv[0])*.9, (ballv[i][1]+dv[1])*.9];
181
182 ++N;
183}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets