# lt3matrix

A lightweight matrix package for LaTeX, intended mainly for matrix
demonstrations, numerical examples, and geometric transformations
in TeX documents.

## Overview

`lt3matrix` provides a lightweight matrix type. Users can create
matrices, set matrix entries, perform matrix operations, iterate
over entries, and typeset matrices in mathematical formulas.

Matrices have a fixed number of rows and columns. Normally the
dimensions should not be changed after creation, and the package
does not provide an interface for directly modifying them;
however, when a matrix is the result of an operation, its
dimensions are updated automatically according to the result.
Matrix entries can be modified via assignment commands. Both
creation and modification are global operations: if a modification
command is executed inside a TeX group, the matrix contents will
 not be restored automatically after the group ends.

An empty matrix also has a definite number of rows and columns, but
contains no entries. The number of rows and columns cannot be negative.

For geometric transformations, users may build a complete
transformation by composing basic transformations. Although the
internal implementation uses homogeneous transformation matrices,
users need no knowledge of them whatsoever.

When applying a transformation, a transformation function is defined
dynamically from the transformation matrix, and this function is
then used to compute transformed coordinates quickly. Each
transformation execution only performs the corresponding arithmetic
operations (carried out by the `fp` module), without repeatedly
retrieving data from the matrix, thereby greatly improving
computational speed.

## AI Usage Statement

AI tools were used as an auxiliary aid in the development
 and documentation of this project.

- **Code**: The code was written and modified manually.
AI was used to help identify potential issues and provide suggestions for
investigation. All code changes and final decisions were made by the author.
- **Documentation**: AI was used to assist in drafting the documentation.
The Chinese version was reviewed and edited by the author,
while the English version was translated by AI based on the Chinese version.

In the event of any discrepancies between the Chinese and
English documentation, the Chinese version shall prevail.

## License

Copyright (C) 2026 Ms_yam

This file may be distributed and/or modified under the terms of the
LaTeX Project Public License (LPPL), version 1.3c or (at your option)
any later version.

The latest version of this license is available at:

http://www.latex-project.org/lppl.txt

This work is maintained.

Current Maintainer: Ms_yam

Contact for bug reports and maintenance: ms_yam@163.com

## Compilation

This package is designed as a single-file package. You can compile it
directly using the following commands:

```sh
# Extract the package files
xetex matrix.dtx

# Compile the documentation
xelatex matrix.dtx
```
