Changeset 2839
 Timestamp:
 May 24, 2017 3:10:28 PM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIImath.py
r2838 r2839 4474 4474 d = nl.norm(np.array(V)) 4475 4475 if d: 4476 V /=d4476 V = V/d 4477 4477 if not A: #==0. 4478 4478 A = 2.*np.pi … … 4493 4493 A = 360. 4494 4494 if d: 4495 V /=d4495 V = V/d 4496 4496 p = A/2. 4497 4497 Q[0] = cosd(p) … … 4507 4507 A = 2.*acosd(Q[0]) 4508 4508 V = np.array(Q[1:]) 4509 V /=sind(A/2.)4509 V = V/sind(A/2.) 4510 4510 return A,V 4511 4511 … … 4516 4516 A = 2.*np.arccos(Q[0]) 4517 4517 V = np.array(Q[1:]) 4518 V /=np.sin(A/2.)4518 V = V/np.sin(A/2.) 4519 4519 return A,V 4520 4520 … … 4548 4548 V2 = np.cross(B,C) 4549 4549 if nl.norm(V1)*nl.norm(V2): 4550 V1 /=nl.norm(V1)4551 V2 /=nl.norm(V2)4550 V1 = V1/nl.norm(V1) 4551 V2 = V2/nl.norm(V2) 4552 4552 V3 = np.cross(V1,V2) 4553 4553 else: … … 4556 4556 D = 0. 4557 4557 if nl.norm(V3): 4558 V3 /=nl.norm(V3)4558 V3 = V3/nl.norm(V3) 4559 4559 D1 = min(1.0,max(1.0,np.vdot(V1,V2))) 4560 4560 D = np.arccos(D1)/2.0
Note: See TracChangeset
for help on using the changeset viewer.