106107108109110111112113114115116
Vector3D v1 = new Vector3D(1, 2, 3); Vector3D v2 = new Vector3D(-3, -2, -1); v1 = v1.subtract(v2); checkVector(v1, 4, 4, 4); checkVector(v2.subtract(v1), -7, -6, -5); checkVector(v2.subtract(3, v1), -15, -14, -13); } public void testAdd() {
107108109110111112113114115116117
Vector3D v2 = new Vector3D(-3, -2, -1); v1 = v1.subtract(v2); checkVector(v1, 4, 4, 4); checkVector(v2.subtract(v1), -7, -6, -5); checkVector(v2.subtract(3, v1), -15, -14, -13); } public void testAdd() { Vector3D v1 = new Vector3D(1, 2, 3);
108109110111112113114115116117118
6465666768697071727374
6566676869707172737475