Magnitude
public struct Magnitude : NumericType
The Magnitude is a unit of flux.
-
The Magnitude value
Declaration
Swift
public let value: Double
-
Creates a new Magnitude instance.
Declaration
Swift
public init(_ value: Double)
Parameters
value
The Magnitude value
-
Combine two magnitudes.
Declaration
Swift
func combine(with m2: Magnitude) -> Magnitude
Parameters
m2
The secondary magnitude
Return Value
The combined magnitude.
-
Compute the brightness ratio, for a given secondary magnitude.
Declaration
Swift
func brightnessRatio(with m2: Magnitude) -> Double
Parameters
m2
The other magnitude.
Return Value
The brightness ratio.
-
Compute the geometrical distance, in parsec, for the current apparent magnitude.
Declaration
Swift
func distance(forAbsoluteMagnitude M: Magnitude, visualAbsorption Av: Magnitude = 0.0) -> Parsec
Parameters
M
The absolute magnitude of the object.
Av
The visual absorption factor.
Return Value
The distance, in parsec.
-
Compute the magnitude difference for a given brightness ratio.
Declaration
Swift
static func magnitudeDifference(forBrightnessRatio r: Double) -> Magnitude
Parameters
r
The brightness ratio.
Return Value
The magnitude difference.