diff options
author | RossTheRoss <msattr@gmail.com> | 2019-04-24 12:45:10 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-04-24 12:45:10 -0500 |
commit | 224844323606b6a2d76bf36946964c3f8fe02e24 (patch) | |
tree | 9d8343b7cb2053c77614760b96f4134584f86e47 /ee1301/wk6 | |
parent | Big e (diff) | |
download | homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar.gz homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar.bz2 homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar.lz homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar.xz homework-224844323606b6a2d76bf36946964c3f8fe02e24.tar.zst homework-224844323606b6a2d76bf36946964c3f8fe02e24.zip |
E
Diffstat (limited to 'ee1301/wk6')
-rw-r--r-- | ee1301/wk6/lab5/vectorArray.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ee1301/wk6/lab5/vectorArray.cpp b/ee1301/wk6/lab5/vectorArray.cpp index 8d2ad38..6e2d548 100644 --- a/ee1301/wk6/lab5/vectorArray.cpp +++ b/ee1301/wk6/lab5/vectorArray.cpp @@ -35,9 +35,9 @@ double randVec() { double momentum(double velocity) { double mass; if (rand()%2+1==0) { - mass=rand()%10+1; + mass=rand()%10+1.0; } else { - mass=rand()%10*-1+1; + mass=rand()%10*-1.0+1.0; } - return velocity*mass; + return mass*velocity; }
\ No newline at end of file |