Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I have a working implementation, but this yours is prettier, so I really wanted it to work. Unfortunately it failed all of my test cases. My tests all look something like quat = diffVectors(v1, v2); assert quat * v1 == v2. Commented May 17, 2012 at 13:09
  • It’s unlikely that this will work at all since angle gets its value from a dot product. Commented Feb 18, 2014 at 9:37
  • 1
    Where is the Quaternion() function? Commented Oct 11, 2019 at 12:06
  • 1
    I haven't tried this, but, looking at it, I think maybe you just need to remove the v.normalize(). So the scalar part of the answer will be v.dot(v2) = (v1+v2).dot(v2) = 1 + v1.dot(v2), and the vector part will be v.cross(v2) = (v1+v2).cross(v2) = v1.cross(v2). Commented Apr 8, 2022 at 19:02