Advertisement
Guest User

Untitled

a guest
Apr 28th, 2024
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from random import randint as i
  2.  
  3. resMax = 50
  4. factorMax = 15
  5.  
  6. class Line:
  7.     x = 0
  8.     y = 0
  9.     z = 0
  10.     a = 0
  11.  
  12. result = Line()
  13.  
  14. def randomInts(line, rndBounds):
  15.     line.x = i(-rndBounds, rndBounds)
  16.     line.y = i(-rndBounds, rndBounds)
  17.     line.z = i(-rndBounds, rndBounds)
  18.     line.a = line.x * result.x + line.y * result.y + line.z * result.z
  19.  
  20. def printMatrixLine(line):
  21.     print(str(line.x) + " " + str(line.y) + " " + str(line.z) + " " + str(line.a))
  22.  
  23. def createMatrixLine():
  24.     line = Line()
  25.     randomInts(line, 15)
  26.     printMatrixLine(line)
  27.  
  28. randomInts(result, 50)
  29. createMatrixLine()
  30. createMatrixLine()
  31. createMatrixLine()
  32. input()
  33. printMatrixLine(result)
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement