PlasmaCalcs.quantities.patterns.vector_arithmetic

File Purpose: arithmetic for vectors or components.
[EFF] the idea for efficiency in vector methods
is that it’s more efficient to get the full vector instead of one component at a time,
if you’ll be using more than one component of it.
For example, if you use electron momentum equation to solve for electric field,
then ‘E’ is complicated to calculate, and involves some scalar factors.
If you get ‘E_x’ then ‘E_y’, you’ll need to recalculate those factors each time.
But if you get ‘E_xy’, then you only need to calculate those factors once
(assuming that get_E is written appropriately, with this in mind).
[TODO] compatibility with rotations (when implementing rotations):
infer X,Y,Z from ‘component’ dimension of array, instead of imposing XYZ.
E.g. if using a rotated coordinate system xprime, yprime, zprime,
then infer X,Y,Z as xprime,yprime,zprime. And crash if mixing coordinate systems…?

Module Attributes

VECTOR_ZERO

Functions

angle_xy(A)

angle_xy_to_hat(A)

cross_component(A, B, x, *[, yz, missing_ok])

cross_product(A, B, *[, components])

dot_product(A, B)

magnitude(A, *[, squared])

parallel(A, B)

parmod(A, B)

perp(A, B)

perpmod(A, B)

rmscomps(A)

take_parallel_to(B, A)

take_perp_to(B, A)

unit_vector(A)

Classes

VectorArithmeticLoader()