1#ifndef PHYTH_DIPOLE_CHARGE_HPP
2#define PHYTH_DIPOLE_CHARGE_HPP
57 const auto dist =
r.Length();
59 throw std::runtime_error(
"DipoleCharge: field diverges at dipole location");
62 const auto hat_r =
r.Normalized();
80 const auto dist =
r.Length();
82 throw std::runtime_error(
"DipoleCharge: potential diverges at dipole location");
85 const auto hat_r =
r.Normalized();
Abstract base class for all charge distributions.
Ideal electric dipole with zero net charge.
Vector3< Quantity< NewtonPerCoulomb > > GetElectricFieldAt(const Vector3< Quantity< Meter > > &point) const override
Compute the electric field of the dipole.
Vector3< Quantity< CoulombMeter > > GetDipoleMoment() const
Vector3< Quantity< Meter > > position_
Vector3< Quantity< CoulombMeter > > p_
DipoleCharge(const Vector3< Quantity< Meter > > &position, const Vector3< Quantity< CoulombMeter > > &dipole_moment)
Construct an electric dipole.
Quantity< Meter > GetMinimumDistanceTo(const Vector3< Quantity< Meter > > &point) const override
Get the minimum distance from a point to the dipole location.
Quantity< Coulomb > GetTotalChargeValue() const override
Get the total charge of the dipole.
Quantity< Volt > GetElectricPotentialAt(const Vector3< Quantity< Meter > > &point) const override
Compute the electric potential of the dipole.
Physical quantity with a value and a compile-time unit.
3D vector with Quantity components