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 (
float
) –imag (
float
) –
- __init__(real, imag)[source]¶
Construct from a real and imaginary scalar.
- Parameters:
real (Scalar) –
imag (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.
- Return type:
List
[float
]
- classmethod from_storage(vec)[source]¶
Construct from a flat list representation. Opposite of .to_storage().
- Parameters:
vec (
Sequence
[float
]) –- Return type:
- classmethod symbolic(name, **kwargs)[source]¶
Construct a symbolic element with the given name prefix. Kwargs are forwarded to sf.Symbol (for example, sympy assumptions).
- Parameters:
name (
str
) –kwargs (
Any
) –
- Return type:
- squared_norm()[source]¶
Squared norm of the two-vector.
- Returns:
real**2 + imag**2
- Return type:
Scalar
- __truediv__(scalar)¶
Scalar element-wise division.
- Parameters:
scalar (Scalar) –
- Return type: