import Wavelength from 'js-electrical-engineering-equations'
const Wavelength = require('js-electrical-engineering-equations').Wavelength
Wavelength
Wavelength represents a wavelength for a given frequency
Example:
let wavelength = new Wavelength('300');
const quarterWavelengthInInches = wavelength.toQuarterWavelength('in');
const quarterWavelengthInFeet = wavelength.toQuarterWavelength('f');
const quarterWavelengthInMeters = wavelength.toQuarterWavelength('m');
const quarterWavelengthInCentimeters = wavelength.toQuarterWavelength('cm');
Constructor Summary
Public Constructor | ||
public |
constructor(frequencyInMegahertz: number, precision: number) |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
setPrecision(precision: number) Sets the precision for the Wavelength object. |
|
public |
Returns the full wavelength of the given frequency in centimeters as a float to the specified decimal precision. |
|
public |
Returns the full wavelength of the given frequency in feet as a float to the specified decimal precision. |
|
public |
toFiveEighthsWavelength(unit: string): number Returns 5/8 wavelength of the given frequency in the specified unit as a float to the specified decimal precision. |
|
public |
Returns the full wavelength of the given frequency in meters as a float to the specified decimal precision. |
|
public |
toHalfWavelength(unit: string): number Returns 1/2 wavelength of the given frequency in the specified unit as a float to the specified decimal precision. |
|
public |
Returns the full wavelength of the given frequency in inches as a float to the specified decimal precision. |
|
public |
toQuarterWavelength(unit: string): number Returns 1/4 wavelength of the given frequency in the specified unit as a float to the specified decimal precision. |
|
public |
|
|
public |
toThreeQuartersWavelength(unit: string): number Returns 3/4 wavelength of the given frequency in the specified unit as a float to the specified decimal precision. |
Public Constructors
Public Members
Public Methods
public setPrecision(precision: number) source
Sets the precision for the Wavelength object.
Params:
Name | Type | Attribute | Description |
precision | number |
public toCentimeters(): number source
Returns the full wavelength of the given frequency in centimeters as a float to the specified decimal precision.
public toFeet(): number source
Returns the full wavelength of the given frequency in feet as a float to the specified decimal precision.
public toFiveEighthsWavelength(unit: string): number source
Returns 5/8 wavelength of the given frequency in the specified unit as a float to the specified decimal precision.
Params:
Name | Type | Attribute | Description |
unit | string |
|
use either 'm' for meters, 'cm' for centimeters, 'f' for feet, or 'in' for inches |
public toFloat(): number source
Returns the full wavelength of the given frequency in meters as a float to the specified decimal precision.
public toHalfWavelength(unit: string): number source
Returns 1/2 wavelength of the given frequency in the specified unit as a float to the specified decimal precision.
Params:
Name | Type | Attribute | Description |
unit | string |
|
use either 'm' for meters, 'cm' for centimeters, 'f' for feet, or 'in' for inches |
public toInches(): number source
Returns the full wavelength of the given frequency in inches as a float to the specified decimal precision.
public toQuarterWavelength(unit: string): number source
Returns 1/4 wavelength of the given frequency in the specified unit as a float to the specified decimal precision.
Params:
Name | Type | Attribute | Description |
unit | string |
|
use either 'm' for meters, 'cm' for centimeters, 'f' for feet, or 'in' for inches |
public toThreeQuartersWavelength(unit: string): number source
Returns 3/4 wavelength of the given frequency in the specified unit as a float to the specified decimal precision.
Params:
Name | Type | Attribute | Description |
unit | string |
|
use either 'm' for meters, 'cm' for centimeters, 'f' for feet, or 'in' for inches |