Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Attention: The newest changes should be on top -->

### Fixed

-
- BUG: Vector encoding breaks MonteCarlo export. [#704](https://github.com/RocketPy-Team/RocketPy/pull/704)

## [v1.6.0] - 2024-09-29

Expand Down
8 changes: 8 additions & 0 deletions rocketpy/mathutils/vector_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ def k():
"""Returns the k vector, [0, 0, 1]."""
return Vector([0, 0, 1])

def to_dict(self):
"""Returns the vector as a JSON compatible element."""
return list(self.components)


class Matrix:
"""Pure Python 3x3 Matrix class for simple matrix-matrix and matrix-vector
Expand Down Expand Up @@ -998,6 +1002,10 @@ def __repr__(self):
+ f" [{self.zx}, {self.zy}, {self.zz}])"
)

def to_dict(self):
"""Returns the matrix as a JSON compatible element."""
return [list(row) for row in self.components]

@staticmethod
def identity():
"""Returns the 3x3 identity matrix."""
Expand Down