Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static IVector subtractVectors(IVector a, IVector b) {
- double vx = a.getVx() - b.getVx();
- double vy = a.getVy() - b.getVy();
- if(a instanceof Vector3D && b instanceof Vector3D) {
- double vz = ((Vector3D) a).getVz() - ((Vector3D) b).getVz();
- return new Vector3D(vx, vy, vz);
- }
- return new Vector(vx, vy);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement