当前位置: 首页>>代码示例>>Python>>正文


Python Math.toRadians方法代码示例

本文整理汇总了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
开发者ID:imclab,项目名称:tournesol,代码行数:11,代码来源:tournesol.py

示例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)
开发者ID:gavalian,项目名称:coatjava,代码行数:6,代码来源:geometryCLAS.py

示例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,\
开发者ID:yaolun,项目名称:sa,代码行数:33,代码来源:plot_image_hipe.py


注:本文中的java.lang.Math.toRadians方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。