本文整理匯總了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))
示例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()