本文整理汇总了Python中FUNC.cos_angle方法的典型用法代码示例。如果您正苦于以下问题:Python FUNC.cos_angle方法的具体用法?Python FUNC.cos_angle怎么用?Python FUNC.cos_angle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FUNC
的用法示例。
在下文中一共展示了FUNC.cos_angle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pdbBoxString
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import cos_angle [as 别名]
def pdbBoxString(box):
# Box vectors
u, v, w = box[0:3], box[3:6], box[6:9]
# Box vector lengths
nu, nv, nw = [math.sqrt(FUNC.norm2(i)) for i in (u, v, w)]
# Box vector angles
alpha = nv*nw == 0 and 90 or math.acos(FUNC.cos_angle(v, w))/d2r
beta = nu*nw == 0 and 90 or math.acos(FUNC.cos_angle(u, w))/d2r
gamma = nu*nv == 0 and 90 or math.acos(FUNC.cos_angle(u, v))/d2r
return pdbBoxLine % (10*FUNC.norm(u), 10*FUNC.norm(v), 10*FUNC.norm(w), alpha, beta, gamma)
示例2: bbGetAngle
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import cos_angle [as 别名]
def bbGetAngle(self, r, ca, ss):
import FUNC, IO
import math
# Elnedyn takes angles from structure, with fc=40
return (
math.acos(FUNC.cos_angle([i - j for i, j in zip(ca[0], ca[1])], [i - j for i, j in zip(ca[2], ca[1])]))
/ IO.d2r,
40,
)
示例3: bbGetAngle
# 需要导入模块: import FUNC [as 别名]
# 或者: from FUNC import cos_angle [as 别名]
def bbGetAngle(self,r,ca,ss):
# Check is it DNA residue
if r[0] in MAP.dnares3:
return ca in self.dnaBbAngleDictC.keys() and self.dnaBbAngleDictC[ca] or None
# RNA is not implemented properly yet
elif r[0] in MAP.rnares3:
return ca in self.rnaBbAngleDictC.keys() and self.rnaBbAngleDictC[ca] or None
# For protein
else:
import FUNC,IO
import math
# Elnedyn takes angles from structure, with fc=40
return (math.acos(FUNC.cos_angle([i-j for i,j in zip(ca[0],ca[1])],[i-j for i,j in zip(ca[2],ca[1])]))/IO.d2r, 40)