示例#1
0
        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:");
        }
示例#2
0
 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;
 }