pyopensn.math.Vector3

class pyopensn.math.Vector3

General 3-element vector structure.

Wrapper of opensn::Vector3.

Examples

>>> a = Vector3(2.0, 3.0, 6.0)
>>> b = Vector3(2.0, 1.0, -1.0)
>>> a + b
Vector3(4, 4, 5)
>>> a - b
Vector3(0, 2, 7)
>>> 2 * a
Vector3(4, 6, 12)
>>> a / 2
Vector3(1, 1.5, 3)
>>> a *= 2
>>> a
Vector3(4, 6, 12)
>>> a /= 2
>>> a
Vector3(2, 3, 6)
>>> a.Norm()
7.0
>>> a @ b  # scalar product
1.0
Norm(self: pyopensn.math.Vector3) float
__init__(self: pyopensn.math.Vector3, x: float = 0.0, y: float = 0.0, z: float = 0.0) None

Construct a 3-element vector object.

Parameters:
  • x (float, default=0.0) – X-coordinate.

  • y (float, default=0.0) – Y-coordinate.

  • z (float, default=0.0) – Z-coordinate.

property x

X-coordinate.

property y

Y-coordinate.

property z

Z-coordinate.