| 3 | from multipyjs import new |
| 4 | |
| 5 | class V3: |
| 6 | def __init__(self, x, y, z): |
| 7 | self.x = x |
| 8 | self.y = y |
| 9 | self.z = z |
| 10 | |
| 11 | def __repr__(self): |
| 12 | return f"V3({self.x}, {self.y}, {self.z})" |
| 13 | |
| 14 | def dot2(self, x, y): |
| 15 | return self.x * x + self.y * y |
| 16 | |
| 17 | def dot3(self, x, y, z): |
| 18 | return self.x * x + self.y * y + self.z * z |
| 19 | |
| 20 | def to_js(self, scale=1.0): |
| 21 | return new(THREE.Vector3, self.x * scale, self.y * scale, self.z * scale) |
| 22 | |
| 23 | PERM = [0] * 512 |
| 24 | V3_P = [0] * 512 # assigned V3s in seed() |
no outgoing calls
no test coverage detected