本文整理汇总了Python中MA.cos方法的典型用法代码示例。如果您正苦于以下问题:Python MA.cos方法的具体用法?Python MA.cos怎么用?Python MA.cos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MA
的用法示例。
在下文中一共展示了MA.cos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTrig
# 需要导入模块: import MA [as 别名]
# 或者: from MA import cos [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))
示例2: list
# 需要导入模块: import MA [as 别名]
# 或者: from MA import cos [as 别名]
# 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()