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


Python MA.sin方法代码示例

本文整理汇总了Python中MA.sin方法的典型用法代码示例。如果您正苦于以下问题:Python MA.sin方法的具体用法?Python MA.sin怎么用?Python MA.sin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MA的用法示例。


在下文中一共展示了MA.sin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testTrig

# 需要导入模块: import MA [as 别名]
# 或者: from MA import sin [as 别名]
 def testTrig (self):
     "Test sin, cos, tan, and their inverses"
     assert eq (MA.arccos(-1.0), MA.pi)
     assert eq (MA.sin(self.a), map(math.sin, self.a))
     assert eq (MA.cos(self.a), map(math.cos, self.a))
     assert eq (MA.tan(self.a), map(math.tan, self.a))
     assert eq (MA.arccos(self.a), map(math.acos, self.a))
     assert eq (MA.arcsin(self.a), map(math.asin, self.a))
     assert eq (MA.arctan(self.a), map(math.atan, self.a))
     assert MA.sin(self.m).shape == self.m.shape
     assert MA.cos(self.m).shape == self.m.shape
     assert MA.tan(self.m).shape == self.m.shape
     assert MA.arcsin(self.m).shape == self.m.shape
     assert MA.arccos(self.m).shape == self.m.shape
     assert MA.arctan(self.m).shape == self.m.shape
     assert eq (MA.sin(self.m).flat, map(math.sin, self.m.flat))
     assert eq (MA.cos(self.m).flat, map(math.cos, self.m.flat))
     assert eq (MA.tan(self.m).flat, map(math.tan, self.m.flat))
     assert eq (MA.arcsin(self.m).flat, map(math.asin, self.m.flat))
     assert eq (MA.arccos(self.m).flat, map(math.acos, self.m.flat))
     assert eq (MA.arctan(self.m).flat, map(math.atan, self.m.flat))
开发者ID:mikeswamp,项目名称:numeric_copy,代码行数:23,代码来源:ntest.py

示例2: list

# 需要导入模块: import MA [as 别名]
# 或者: from MA import sin [as 别名]
# Tutorial for xmgrace module, using Numeric only

# it is recomended to run it usibng parser.py or just read it

print 'it is recomended to run this file using parser.py or just read it'

import MA

TEMPDIR = './'

# First let's create some data
npoints=50
X=MA.arrayrange(npoints,typecode=MA.Float)
X=X/float(npoints)*2.*MA.pi

Y1=MA.sin(X)
Y2=MA.cos(X)
Y3=MA.tan(X)

# Now the real grace thing, plot the 2 on one graph and the diff on another graph

from genutil import xmgrace # first we need to import xmgrace module

x=xmgrace.init() # create our xmgrace object

# First let's set our graphs area
# graph 0, exist by default, but we need to add 1 graph, therefore:
x.add_graph() # adds one graph to our graph list (x.Graph)

# Let's change the orientation of the page to portrait
x.portrait()
开发者ID:UV-CDAT,项目名称:cdat-site,代码行数:33,代码来源:xmgrace_tutorial_Numeric.py


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