Vector Field Modifications
batch_normalize(vec)
Normalize a batch of vectors along axis 0. Zero-length vectors are left as zeros to avoid division by zero.
| Parameters: |
|
|---|
| Returns: |
|
|---|
add_vectors(vec, add_vec)
Add a vector (field) from vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
subtract_vectors(vec, subtract_vec)
Subtract a vector (field) from vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rescale_vectors(vec, scale)
Multiply the vector field by a scalar, or scale each vector per-point by the scale array.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_phi(vec, phis)
Rotate each vector by an angle phi about the z-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_theta(vec, thetas)
Rotate each vector by an angle theta about the axis perpendicular to both the
vector and the z-axis. This corresponds to tilting each vector out of its own
xy-projection direction.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_x_axis(vec, alpha)
Rotate each vector by an angle alpha about the x-axis. The x-component is
unchanged.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_y_axis(vec, alpha)
Rotate each vector by an angle alpha about the y-axis. The y-component is
unchanged.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_z_axis(vec, alpha)
Rotate each vector by an angle alpha about the z-axis. The z-component is
unchanged. Equivalent to rotate_vectors_phi but named for consistency with the
x-axis and y-axis rotation functions.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_vectors_axis(vec, axes, alpha)
Rotate each vector by an angle alpha about an arbitrary axis using the
Rodrigues rotation formula.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolve_field_x(r, vec)
Revolve a vector field about the x-axis. At each point r, the vector is
rotated by the azimuthal angle arctan2(z, y) about the x-axis, so that a
field defined on the xy-plane is extended radially around the x-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolve_field_y(r, vec)
Revolve a vector field about the y-axis. At each point r, the vector is
rotated by the azimuthal angle arctan2(z, x) about the y-axis, so that a
field defined on the xy-plane is extended radially around the y-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolve_field_z(r, vec)
Revolve a vector field about the z-axis. At each point r, the vector is
rotated by the azimuthal angle arctan2(y, x) about the z-axis, so that a
field defined on the xz-plane is extended radially around the z-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|