Ejemplo n.º 1
0
 public static Newton ForceBetween(IPhysicalObject physicalObject, IPhysicalObject otherObject)
 {
     Meter distanceBetween = physicalObject.GetCoordinates<Meter>().DistanceFrom<Meter>(otherObject.GetCoordinates<Meter>());
     var distanceSquared = new Meter(System.Math.Pow(distanceBetween.Value, 2));
     var chargeProduct = physicalObject.GetCharge().Multiply(otherObject.GetCharge());
     return new Newton((CoulombsConstant.Multiply(chargeProduct).Divide(distanceSquared)).Value);
 }
Ejemplo n.º 2
0
        public static Newton ForceBetween(IPhysicalObject physicalObject, IPhysicalObject otherObject)
        {
            Meter distanceBetween = physicalObject.GetCoordinates <Meter>().DistanceFrom <Meter>(otherObject.GetCoordinates <Meter>());
            var   distanceSquared = new Meter(System.Math.Pow(distanceBetween.Value, 2));
            var   chargeProduct   = physicalObject.GetCharge().Multiply(otherObject.GetCharge());

            return(new Newton((CoulombsConstant.Multiply(chargeProduct).Divide(distanceSquared)).Value));
        }