kerou / mt4j

Automatically exported from code.google.com/p/mt4j
GNU General Public License v2.0
0 stars 0 forks source link

Subtracting the same vector results in Nan distance vector #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a vector, make a copy of it.
2. Subtract the one from the other (use getSubtracted)
3.

What is the expected output? What do you see instead?
the result should be (0,0,0), but result is (Nan,Nan,Nan)

What version of the product are you using? On what operating system?
Latest version in SVN on Mac OS X 10.6.7

Original issue reported on code.google.com by michael....@gmail.com on 29 Apr 2011 at 1:29

GoogleCodeExporter commented 9 years ago
Couldnt reproduce that..

Used this code:
Vector3D a = new Vector3D(1,1,1);
        Vector3D b = new Vector3D(1,1,1);
        Vector3D c = a.getSubtracted(b);
        System.out.println("C: " + c);

        Vector3D a1 = a.getCopy();
        Vector3D c1 = a.getSubtracted(a1);
        System.out.println("C1: " + c1);

        System.out.println("C2:" + new Vector3D(100,100,100,1).getSubtracted(new Vector3D(100,100,100,1)));

And it always correctly returns the vector (0,0,0)

Can you post a testcase showcasing the problem?

Original comment by sirhc.f...@gmail.com on 1 Jun 2011 at 9:07