Vector3D
A vector in 3D space. Used for directions, positions, or scalar-like 3D values across the Telekinesis ecosystem.
Field
Required
| Field | Type | Description |
|---|---|---|
xyz | ArrayLike | 3D vector; shape (3,). |
Optional
None.
Methods
| Method | Description |
|---|---|
to_list() | Returns a Python list of 3 floats: [x, y, z]. |
to_numpy() | Returns a NumPy array of shape (3,), dtype float32, with elements [x, y, z]. |
Example
From the datatypes examples:
python
import numpy as np
from datatypes import datatypes
from loguru import logger
# ------------------------------------------------
# 1. Create Vector3D instance
# ------------------------------------------------
xyz = np.array([1.0, 2.0, 3.0], dtype=np.float32)
vec_3d = datatypes.Vector3D(xyz)
# ------------------------------------------------
# 2. Access data via to_list and to_numpy
# ------------------------------------------------
data_list = vec_3d.to_list()
logger.info("Vector3D to_list x={}", data_list[0])
logger.info("Vector3D to_list y={}", data_list[1])
logger.info("Vector3D to_list z={}", data_list[2])
logger.info("Vector3D to_numpy shape={}", vec_3d.to_numpy().shape)
