Ignore:
Timestamp:
Oct 2, 2013 3:42:53 PM (8 years ago)
Author:
vondreele
Message:

implement new March-Dollase term in MC/SA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIlattice.py

    r1046 r1075  
    305305    return np.sum(E)/3.
    306306       
     307def CosAngle(U,V,G):
     308    """ calculate cos of angle between U & V in generalized coordinates
     309    defined by metric tensor G
     310
     311    :param U: 3-vectors assume numpy arrays, can be multiple reflections as (N,3) array
     312    :param V: 3-vectors assume numpy arrays, only as (3) vector
     313    :param G: metric tensor for U & V defined space assume numpy array
     314    :returns:
     315        cos(phi)
     316    """
     317    u = (U.T/np.sqrt(np.sum(np.inner(U,G)*U,axis=1))).T
     318    v = V/np.sqrt(np.inner(V,np.inner(G,V)))
     319    cosP = np.inner(u,np.inner(G,v))
     320    return cosP
     321   
    307322def CosSinAngle(U,V,G):
    308323    """ calculate sin & cos of angle between U & V in generalized coordinates
Note: See TracChangeset for help on using the changeset viewer.