🐉 Author: Samuele Ferri (@ferrixio)
⭐ Version 2.2.4
📊 Status: closed
Python version: 3.10 or above
Additional packages: numpy, matplotlib
This class allows user to emulate quaternionic algebra in Python. The class can do:
> internal and external sums
> scalar multiplications
> internal left-multiplications
> internal right-multiplications
> integer powers
> divisions
> floordivisions
> modulos
> normalizations
> conjugations
> inversions
> algebric prints
> type casting (int, float, complex)
> iterations
> random generations
> exponential and logarithmic functions
> dot product, cross product and commutator
> extraction or generation from 3D rotations
> rotate points in 3D
> plotting quaternions
I used mostly magic methods to allow users to write x+y
, x*y
, x/y
, ..., directly.
I recommend reading how to build a quaternion
to better understand how to define and use a quaternion.
Every value below 1e-13 is treated as 0, especially during logical checks. This does NOT imply that the value is set to 0!
The new class Hplot
is used to plot quaternions in different ways. Also, I invite you to read how to plot quaternions
to understand how to plot them.
The class functions
contains many methods to perform quaternionic calculus [work in progress].
"agc" in the title stands for "algebra-geometry-calculus".
- The in_place operations +=, -=, *= and so on, don't work if on the left side there isn't a quaternion.
- There is a little chance that the method
Hplot.__getColors
returns negative numbers.
- ⭕ Add custom quaternionic functions
- ⭕ Add more algebra and calculus to the field
- ⭕ Add colorbar in plot to represent the real parts
- ⭕ Study the topology of lists of quaternions
- ✅ Vector representation
- ✅ Add complex compatibility
- ✅ Quaternionic functions
- ✅ Floor division
- ✅ Add @ operator
- ✅ Plotting quaternions
- ✅ Autogeneration of versors
- ✅ Literally use LaTeX to write the .md files
- ✅ Create a library/package
⚠️ Implementing rotation of 3D objects
⭕ = solution not (yet) found
✅ = solution found and implemented