|
2 | 2 |
|
3 | 3 | class DBRprop:
|
4 | 4 | def __init__(self):
|
5 | | - self.nbr = np.random.randint(15,5000) |
| 5 | + self.nbr = np.random.randint(15,5000) |
6 | 6 | self.n = np.random.rand(2)*5 + 0.00000001
|
7 | | - self.d = np.random.rand(2)*10000+ 3 |
| 7 | + self.d = np.random.rand(2)*10000+ 3 |
8 | 8 | # creation of array of data representing the mirror
|
9 | | - self.data = np.array([[self.n[0], 0]]) |
10 | | - self.data = np.vstack((self.data, [self.n[1], self.d[1]])) |
11 | | - for k in range(self.nbr - 4): |
12 | | - self.data = np.vstack((self.data, [self.n[0], self.d[0]])) |
13 | | - self.data = np.vstack((self.data, [self.n[1], self.d[1]])) |
14 | | - self.data = np.vstack((self.data, [self.n[0], self.d[0]])) |
15 | | - self.data = np.vstack((self.data, [self.n[1],0])) |
| 9 | + self.data = np.tile(np.array([[self.n[0], self.d[0]], [self.n[1], self.d[1]]]), (self.nbr, 1)) |
| 10 | + self.data[0, 1] = 0 |
| 11 | + self.data[-1, 1] = 0 |
16 | 12 |
|
0 commit comments