using System; namespace Science.Physics.GeneralPhysics { /// /// MagneticDipoleMoment /// public class MagneticDipoleMoment: Vector { private void SetDim() { this.DimensionMass = 0; this.DimensionLength = 2; this.DimensionTime = -1; this.DimensionCharge = 1; } public MagneticDipoleMoment() { SetDim(); } public MagneticDipoleMoment(ElectricCurrent I, AreaVector A) { SetDim(); this.X = I.A*A.X; this.Y = I.A*A.Y; this.Z = I.A*A.Z; } public Torque TorqueInMagneticField(MagneticField B) { Torque tau = new Torque(); tau.X = this.Y*B.Z - this.Z*B.Y; tau.Y = this.Z*B.X - this.X*B.Z; tau.Z = this.X*B.Y - this.Y*B.X; return tau; } public PotentialEnergy PotentialEnergyInMagneticField(MagneticField B) { PotentialEnergy U = new PotentialEnergy(); U.J = - this.X*B.X - this.Y*B.Y - this.Z*B.Z; return U; } public override string ToString() { return base.ToString() + "(Am^2)"; } } }