Changeset 755
- Timestamp:
- Sep 8, 2012 10:14:53 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImath.py
r753 r755 1065 1065 Q = np.zeros(4) 1066 1066 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 1068 1071 p = A/2. 1069 1072 Q[0] = np.cos(p) … … 1078 1081 Q = np.zeros(4) 1079 1082 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 1081 1087 p = A/2. 1082 1088 Q[0] = cosd(p) -
trunk/GSASIIphsGUI.py
r754 r755 1564 1564 'vdwScale':0.67,'ellipseProb':50,'sizeH':0.50,'unitCellBox':False, 1565 1565 'showABC':True,'selectedAtoms':[],'Atoms':[],'oldxy':[], 1566 'Quaternion':[ 0.0,0.0,1.0,0.0],'bondList':{},'viewDir':[0,0,1]}1566 'Quaternion':[1.0,0.0,0.0,0.0],'bondList':{},'viewDir':[0,0,1]} 1567 1567 try: 1568 1568 drawingData = data['Drawing'] … … 1577 1577 drawingData['viewDir'] = [0,0,1] 1578 1578 if 'Quaternion' not in drawingData: 1579 drawingData['Quaternion'] = [ 0.0,0.0,1.0,0.0]1579 drawingData['Quaternion'] = [1.0,0.0,0.0,0.0] 1580 1580 cx,ct,cs,ci = [0,0,0,0] 1581 1581 if generalData['Type'] == 'nuclear': -
trunk/GSASIIplot.py
r754 r755 2672 2672 #first get rotation vector (= view vector) in screen coords. & angle increment 2673 2673 View = glGetIntegerv(GL_VIEWPORT) 2674 cent = [View[2]/2,View[3]/2] 2674 2675 oldxy = drawingData['oldxy'] 2675 2676 if not len(oldxy): oldxy = list(newxy) … … 2677 2678 drawingData['oldxy'] = list(newxy) 2678 2679 V = drawingData['viewDir'] 2679 X0 = drawingData['viewPoint'][0] 2680 A = (dxy[0]+dxy[1])*.25 2681 # next transform vector back to xtal coordinates via inverse quaternion 2682 # & make new quaternion 2680 A = [0,0] 2681 A[0] = dxy[1]*.25 2682 A[1] = dxy[0]*.25 2683 if newxy[0] > cent[0]: 2684 A[0] *= -1 2685 if newxy[1] < cent[1]: 2686 A[1] *= -1 2687 # next transform vector back to xtal coordinates & make new quaternion 2683 2688 Q = drawingData['Quaternion'] 2684 2689 V = np.inner(Amat,V) 2685 DQ = G2mth.AVdeg2Q(A,V) 2686 Q = G2mth.prodQQ(Q,DQ) 2690 Qx = G2mth.AVdeg2Q(A[0],V) 2691 Qy = G2mth.AVdeg2Q(A[1],V) 2692 Q = G2mth.prodQQ(Q,Qx) 2693 Q = G2mth.prodQQ(Q,Qy) 2687 2694 drawingData['Quaternion'] = Q 2688 2695
Note: See TracChangeset
for help on using the changeset viewer.