Non-uniform current stimuli can be specified easier

This commit is contained in:
2020-12-06 20:56:34 -08:00
parent d619383fb9
commit d9176cdf06
5 changed files with 123 additions and 21 deletions

View File

@@ -162,6 +162,16 @@ impl Vec3 {
self.elem_mul(other).component_sum()
}
pub fn cross(&self, other: Self) -> Self {
// det( i j k |
// | s.x s.y s.z |
// | o.x o.y o.z )
let x = self.y * other.z - other.y * self.z;
let y = other.z * self.z - self.x * other.z;
let z = self.x * other.y - other.x * self.y;
Self { x, y, z }
}
/// Perform element-wise multiplication with `other`.
pub fn elem_mul(&self, other: Self) -> Self {
Self {