static void TestFieldTransforms(EuclideanVector3 E, EuclideanVector3 B, EuclideanVector3 Ep, EuclideanVector3 Bp, EuclideanVector3 v) { Symbol gamma = LorentzTransform.Gamma(v); Assert.AreEqual(Ep.ParallelComponent(v), E.ParallelComponent(v), "E Parallel component:"); Assert.AreEqual(Ep.PerpendicularComponent(v), gamma * (E + v.Cross(B)).PerpendicularComponent(v), "E Perpendicular component:"); Assert.AreEqual(Bp.ParallelComponent(v), B.ParallelComponent(v), "B Parallel component:"); Assert.AreEqual(Bp.PerpendicularComponent(v), gamma * (B - v.Cross(E)).PerpendicularComponent(v), "B Perpendicular component:"); }
public RelativisticParticle(Symbol mass, EuclideanVector3 position, Variable time) { this.Mass = mass; this.Position = new LorentzVectorU(time, position); Operator dt = new Derivative(time); EuclideanVector3 v = dt * position; this.Gamma = LorentzTransform.Gamma(v); this.Velocity = this.Gamma * new LorentzVectorU(Symbol.One, v); this.InvariantTimeDerivative = this.Gamma * dt; }
static void TestLorentzTransform(EuclideanVector3 v) { LorentzVectorVariableU x0 = new LorentzVectorVariableU("t", "x", "y", "z"); LorentzVectorU x1 = x0.Transform(v); LorentzVectorU x2 = x1.Transform(-v); Assert.AreEqual(x0, x2); Assert.AreEqual(LorentzMatrixUL.One, LorentzTransform.Matrix(v) * LorentzTransform.Matrix(-v)); }
public LorentzVectorOperatorU Transform(EuclideanVector3 velocity) { return(LorentzTransform.Matrix(velocity) * this); }
public RelativisticParticle Transform(EuclideanVector3 velocity) { LorentzMatrixUL L = LorentzTransform.Matrix(velocity); return new RelativisticParticle(this.Mass, L * this.Position, this.InvariantTimeDerivative); }
public ElectromagneticField Transform(EuclideanVector3 velocity) { LorentzMatrixUL L = LorentzTransform.Matrix(velocity); return(new ElectromagneticField(L * this.Potential, L.Invert() * this.Del)); }
public LorentzVectorL Transform(EuclideanVector3 velocity) { return(this * LorentzTransform.Matrix(velocity)); }