Cleanup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
module Quaternion
|
||||
where
|
||||
import Geometry.Data
|
||||
import Geometry.Vector3D
|
||||
import qualified Linear.Quaternion as Q
|
||||
|
||||
-- apply a rotation as if the z axis moves to the new point.
|
||||
rotateToZ :: Point3 -> Point3 -> Point3
|
||||
rotateToZ z1
|
||||
| cprod == V3 0 0 0 = id
|
||||
| otherwise = Q.rotate $ Q.axisAngle cprod (angleVV3 z1 (V3 0 0 1))
|
||||
where
|
||||
cprod = crossProd z1 (V3 0 0 1)
|
||||
Reference in New Issue
Block a user