-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsali.py
More file actions
executable file
·28 lines (28 loc) · 687 Bytes
/
sali.py
File metadata and controls
executable file
·28 lines (28 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# FileName: sali.py
#
# Description:
#
# Version: 1.0
# Created: 2018-07-03 10:37:11
# Last Modified: 2018-07-03 10:37:16
# Revision: none
# Compiler: gcc
#
# Author: zt ()
# Organization:
import numpy as np
from matplotlib.pyplot import plot
from matplotlib.pyplot import show
import sys
# (1) 使用linspace函数初始化变量t,即从-pi到pi上均匀分布的201个点
a = float(9)
b = float(8)
t = np.linspace(-np.pi, np.pi, 201)
# (2) 使用sin函数和NumPy常量pi计算变量x
x = np.sin(a * t + np.pi / 2)
# (3) 使用sin函数计算变量y
y = np.sin(b * t)
plot(x, y)
show()