本文整理汇总了Python中java.lang.Math.toRadians方法的典型用法代码示例。如果您正苦于以下问题:Python Math.toRadians方法的具体用法?Python Math.toRadians怎么用?Python Math.toRadians使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.Math
的用法示例。
在下文中一共展示了Math.toRadians方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newElement
# 需要导入模块: from java.lang import Math [as 别名]
# 或者: from java.lang.Math import toRadians [as 别名]
def newElement(self):
theta = Math.toRadians(self.angle)
element = Element(self, complex(R0 * math.cos(theta), R0 * math.sin(theta)))
self.angle = self.angle + self.forcedDivergence
if self.angle > 360.0:
self.angle = self.angle - 360.0
return element
示例2: getParticleDeg
# 需要导入模块: from java.lang import Math [as 别名]
# 或者: from java.lang.Math import toRadians [as 别名]
def getParticleDeg(pid, mom, theta,phi):
theta_rad = Math.toRadians(theta)
phi_rad = Math.toRadians(phi)
return getParticle(pid,mom,theta_rad,phi_rad)
示例3: cos
# 需要导入模块: from java.lang import Math [as 别名]
# 或者: from java.lang.Math import toRadians [as 别名]
# 2) The PlotXY axis system assumes that coordinates are a linear
# transformation of pixel coordinates. So coordinates on the plotted axes
# are not fully correct in some projections. They are correct only for small
# angles near the projection reference.
# Extract the WCS of the map and put some WCS info into variables
wcs=map.wcs
crpix1=wcs.crpix1
crpix2=wcs.crpix2
crval1=wcs.crval1
crval2=wcs.crval2
cdelt1=wcs.cdelt1
cdelt2=wcs.cdelt2
naxis1=wcs.naxis1
naxis2=wcs.naxis2
# cos(Dec)
cosd=Math.cos(Math.toRadians(crval2))
# Set the origin and the scale of the axes so that they coincide with the WCS.
myPlot[0].xcdelt=cdelt1/cosd # note the cos(Dec)!!!
myPlot[0].ycdelt=cdelt2
myPlot[0].xcrpix=crpix1
myPlot[0].ycrpix=crpix2
myPlot[0].xcrval=crval1
myPlot[0].ycrval=crval2
# Change the axis type so that we have ticks in degrees/hours, min, sec
# and the RA growing toward the left.
myPlot.xaxis.type=Axis.RIGHT_ASCENSION
myPlot.yaxis.type=Axis.DECLINATION
myPlot.xaxis.titleText="Right Ascension (J2000)"
myPlot.yaxis.titleText="Declination (J2000)"
# Set the axes ranges so that the image fills completely the plotting area
xrange=[crval1-(crpix1-0.5)*cdelt1/cosd*0.1,\