Skip to content

Instantly share code, notes, and snippets.

@henryscala
Created September 11, 2014 10:13
Show Gist options
  • Save henryscala/a6b9eb272276e97e78fa to your computer and use it in GitHub Desktop.
Save henryscala/a6b9eb272276e97e78fa to your computer and use it in GitHub Desktop.
vector operations
import 'dart:math';
addv(v1, v2){
return [v1[0]+v2[0],v1[1]+v2[1]];
}
subv(v1,v2){
return [v1[0]-v2[0],v1[1]-v2[1]];
}
absv(v){
return sqrt(v[0]*v[0]+v[1]*v[1]);
}
void main() {
var u=[4,3];
var v=[-7,2];
print('${atan(1/11)/PI*180}');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment