symforce.geo.complex module¶
- class Complex(real, imag)[source]¶
Bases:
Group
A complex number is a number that can be expressed in the form a + bi, where a and b are real numbers, and i is a solution of the equation x**2 = -1. Because no real number satisfies this equation, i is called an imaginary number. For the complex number a + bi, a is called the real part, and b is called the imaginary part. Despite the historical nomenclature “imaginary”, complex numbers are regarded in the mathematical sciences as just as “real” as the real numbers, and are fundamental in many aspects of the scientific description of the natural world.
A complex number is also a convenient way to store a two-dimensional rotation.
References
https://en.wikipedia.org/wiki/Complex_number
- Parameters:
real (T.Scalar) –
imag (T.Scalar) –
- to_storage()[source]¶
Flat list representation of the underlying storage, length of
storage_dim()
. This is used purely for plumbing, it is NOT like a tangent space.
- classmethod from_storage(vec)[source]¶
Construct from a flat list representation. Opposite of
to_storage()
.
- classmethod symbolic(name, **kwargs)[source]¶
Construct a symbolic element with the given name prefix. Kwargs are forwarded to
sf.Symbol
(for example, sympy assumptions).
- squared_norm()[source]¶
Squared norm of the two-vector.
- Returns:
Scalar – real**2 + imag**2
- Return type:
- __truediv__(scalar)[source]¶
Scalar element-wise division.
- Parameters:
scalar (Scalar) –
- Returns:
Complex
- Return type: