Actually, that was NOT the problem. I put a println to show the value of v.mag was non-zero, and still not working, so I made a tester class, run this:
public class mVectorTester {
/**
...
Type: Posts; User: Zula
Actually, that was NOT the problem. I put a println to show the value of v.mag was non-zero, and still not working, so I made a tester class, run this:
public class mVectorTester {
/**
...
Hah, okay, the problem was hat I was passing a 0 for magnitude of new vector...rather than .735 as predicted...uncaught loss of precision due to multiplying by a long perhaps..
public class mVector {
public double mag;
public double dir;
public mVector(double mag, double dir) {
this.mag = mag;
this.dir = dir;
}
public void addVector(mVector v) {
double...
public void addVector(mVector v) {
double rx = v.getXComponent()+getXComponent();
double ry = v.getYComponent()+getYComponent();
mag = Math.sqrt((rx*rx)+(ry*ry));
dir =...