Class LinearScale
A class that converts between two linear ranges.
Inherited Members
Namespace: AudioAnalysisTools.Scales
Assembly: AudioAnalysisTools.dll
Syntax
public class LinearScale
Constructors
| Improve this Doc View SourceLinearScale((Double Low, Double High), (Double Low, Double High))
Initializes a new instance of the LinearScale class.
Declaration
public LinearScale((double Low, double High) domain, (double Low, double High) range)
Parameters
Type | Name | Description |
---|---|---|
(T1, T2)<Double, Double> | domain | The range to consider the domain (the input). |
(T1, T2)<Double, Double> | range | The range to consider the range (the output). |
Remarks
Should be able to handle mapping a domain where x1 ≤ x < x2 to a range where y1 > y ≥ y2 (an inverted mapping).
LinearScale((Double Low, Double High), (Double Low, Double High), Boolean)
Declaration
public LinearScale((double Low, double High) domain, (double Low, double High) range, bool clamp)
Parameters
Type | Name | Description |
---|---|---|
(T1, T2)<Double, Double> | domain | |
(T1, T2)<Double, Double> | range | |
Boolean | clamp | Whether or not to clamp the values to the end points. |
Remarks
If clamp
is
Methods
| Improve this Doc View SourceFrom(Double)
Converts a value from the range into its domain equivalent.
Declaration
public double From(double y)
Parameters
Type | Name | Description |
---|---|---|
Double | y | The range value. |
Returns
Type | Description |
---|---|
Double | The equivalent domain value. |
FromMagnitude(Double)
Converts a range magnitude into a domain magnitude.
Declaration
public double FromMagnitude(double yMagnitude)
Parameters
Type | Name | Description |
---|---|---|
Double | yMagnitude | The range magnitude. |
Returns
Type | Description |
---|---|
Double | The equivalent domain magnitude. |
To(Double)
Converts a value from the domain into its range equivalent.
Declaration
public double To(double x)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The domain value. |
Returns
Type | Description |
---|---|
Double | The equivalent range value. |
ToMagnitude(Double)
Converts a domain magnitude into a range magnitude.
Declaration
public double ToMagnitude(double xMagnitude)
Parameters
Type | Name | Description |
---|---|---|
Double | xMagnitude | The domain magnitude. |
Returns
Type | Description |
---|---|
Double | The equivalent range magnitude. |