Changeset 755 for trunk/GSASIImath.py


Ignore:
Timestamp:
Sep 8, 2012 10:14:53 AM (10 years ago)
Author:
vondreele
Message:

fix rotation about view direction
eliminate divide by zero error in quaternion stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r753 r755  
    10651065    Q = np.zeros(4)
    10661066    d = np.sqrt(np.sum(np.array(V)**2))
    1067     V /= d
     1067    if d:
     1068        V /= d
     1069    else:
     1070        return [1.,0.,0.,0.]    #identity
    10681071    p = A/2.
    10691072    Q[0] = np.cos(p)
     
    10781081    Q = np.zeros(4)
    10791082    d = np.sqrt(np.sum(np.array(V)**2))
    1080     V /= d
     1083    if d:
     1084        V /= d
     1085    else:
     1086        return [1.,0.,0.,0.]    #identity
    10811087    p = A/2.
    10821088    Q[0] = cosd(p)
Note: See TracChangeset for help on using the changeset viewer.