Table of Contents

Struct MagneticField

Namespace
UnitsNet
Assembly
UnitsNet.MagneticField.dll

A magnetic field is a force field that is created by moving electric charges (electric currents) and magnetic dipoles, and exerts a force on other nearby moving charges and magnetic dipoles.

public struct MagneticField

Remarks

Constructors

MagneticField(double, MagneticFieldUnit)

Creates the quantity with the given numeric value and unit.

public MagneticField(double value, MagneticFieldUnit unit)

Parameters

value double

The numeric value to construct this quantity with.

unit MagneticFieldUnit

The unit representation to construct this quantity with.

Exceptions

ArgumentException

If value is NaN or Infinity.

Properties

BaseUnit

The base unit of MagneticField, which is Second. All conversions go via this value.

public static MagneticFieldUnit BaseUnit { get; }

Property Value

MagneticFieldUnit

Gausses

Gets a double value of this quantity converted into Gauss

public double Gausses { get; }

Property Value

double

MaxValue

Represents the largest possible value of MagneticField.

public static MagneticField MaxValue { get; }

Property Value

MagneticField

Microteslas

Gets a double value of this quantity converted into Microtesla

public double Microteslas { get; }

Property Value

double

Milligausses

Gets a double value of this quantity converted into Milligauss

public double Milligausses { get; }

Property Value

double

Milliteslas

Gets a double value of this quantity converted into Millitesla

public double Milliteslas { get; }

Property Value

double

MinValue

Represents the smallest possible value of MagneticField.

public static MagneticField MinValue { get; }

Property Value

MagneticField

Nanoteslas

Gets a double value of this quantity converted into Nanotesla

public double Nanoteslas { get; }

Property Value

double

Teslas

Gets a double value of this quantity converted into Tesla

public double Teslas { get; }

Property Value

double

Unit

public MagneticFieldUnit Unit { get; }

Property Value

MagneticFieldUnit

Value

The numeric value this quantity was constructed with.

public double Value { get; }

Property Value

double

Zero

Gets an instance of this quantity with a value of 0 in the base unit Second.

public static MagneticField Zero { get; }

Property Value

MagneticField

Methods

As(MagneticFieldUnit)

Convert to the unit representation unit.

public double As(MagneticFieldUnit unit)

Parameters

unit MagneticFieldUnit

Returns

double

Value converted to the specified unit.

From(double, MagneticFieldUnit)

Dynamically convert from value and unit enum MagneticFieldUnit to MagneticField.

public static MagneticField From(double value, MagneticFieldUnit fromUnit)

Parameters

value double

Value to convert from.

fromUnit MagneticFieldUnit

Unit to convert from.

Returns

MagneticField

MagneticField unit value.

FromGausses(double)

Creates a MagneticField from Gauss.

public static MagneticField FromGausses(double gausses)

Parameters

gausses double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMicroteslas(double)

Creates a MagneticField from Microtesla.

public static MagneticField FromMicroteslas(double microteslas)

Parameters

microteslas double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMilligausses(double)

Creates a MagneticField from Milligauss.

public static MagneticField FromMilligausses(double milligausses)

Parameters

milligausses double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

FromMilliteslas(double)

Creates a MagneticField from Millitesla.

public static MagneticField FromMilliteslas(double milliteslas)

Parameters

milliteslas double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

FromNanoteslas(double)

Creates a MagneticField from Nanotesla.

public static MagneticField FromNanoteslas(double nanoteslas)

Parameters

nanoteslas double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

FromTeslas(double)

Creates a MagneticField from Tesla.

public static MagneticField FromTeslas(double teslas)

Parameters

teslas double

Returns

MagneticField

Exceptions

ArgumentException

If value is NaN or Infinity.

ToUnit(MagneticFieldUnit)

Converts this MagneticField to another MagneticField with the unit representation unit.

public MagneticField ToUnit(MagneticFieldUnit unit)

Parameters

unit MagneticFieldUnit

Returns

MagneticField

A MagneticField with the specified unit.