本文整理汇总了Python中Physics.norm方法的典型用法代码示例。如果您正苦于以下问题:Python Physics.norm方法的具体用法?Python Physics.norm怎么用?Python Physics.norm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Physics
的用法示例。
在下文中一共展示了Physics.norm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __set_g
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import norm [as 别名]
def __set_g(self, g):
self.__g = array(g)
self.gnorm = Physics.norm(g)
self.gnormalized = Physics.normalize(g)
# angular coordinates (azimuth and colatitude) of the g versor
self.gtheta = math.acos(self.gnormalized[2])
self.gphi = Physics.atan2(g[1], g[0])
示例2: __set_k
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import norm [as 别名]
def __set_k(self, k):
self.__k = array(k)
self.knorm=Physics.norm(k)
self.knormalized = Physics.normalize(k)
# Calculates wavelength and energy of the photon
if self.knorm==0.:
self.__e, self.__lam=0., '+inf'
else:
self.__lam=2.*pi/self.knorm
self.__e=Booklet.hc/self.__lam
示例3: __set_g
# 需要导入模块: import Physics [as 别名]
# 或者: from Physics import norm [as 别名]
def __set_g(self, g):
self.__g = array(g)
self.gnorm = Physics.norm(g)
self.gnormalized = Physics.normalize(g)
# angular coordinates of the reciprocal lattice vector g
# gtheta is the polar angle (the angle between z axis and g vector)
# gphi is the azimuthal angle (in the plane xy, from the x axis)
self.gtheta = math.acos(self.gnormalized[2])
self.gphi = Physics.atan2(g[1], g[0])