measurement-toolkit › "Speed" › Speed
Class: Speed
Hierarchy
↳ Speed
Implements
Index
Constructors
Properties
Accessors
Methods
- add
- convert
- divideBy
- getConverters
- getDistanceOverTime
- getTimeOverDistance
- multiply
- percentageOf
- subtract
- toString
Constructors
constructor
+ new Speed(distance
: IUnitOfLength, time
: IUnitOfTime): Speed
Defined in Speed.ts:18
Parameters:
Name | Type |
---|---|
distance |
IUnitOfLength |
time |
IUnitOfTime |
Returns: Speed
Properties
distance
• distance: IUnitOfLength
Defined in Speed.ts:17
time
• time: IUnitOfTime
Defined in Speed.ts:18
Accessors
to
• get to(): any
Defined in Unit.ts:14
Returns: any
Methods
add
▸ add(unit
: Speed): this
Defined in Speed.ts:83
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: this
convert
Defined in Speed.ts:27
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: Speed
divideBy
▸ divideBy(unit
: Speed): this
Defined in Speed.ts:92
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: this
getConverters
▸ getConverters(): object
Inherited from Unit.getConverters
Defined in Unit.ts:18
Returns: object
- [ key: string]: function
▸ (): IUnit
getDistanceOverTime
▸ getDistanceOverTime(duration
: IUnitOfLength): IUnitOfLength
Defined in Speed.ts:62
Returns the distance traveled after spending the given time
Parameters:
Name | Type |
---|---|
duration |
IUnitOfLength |
Returns: IUnitOfLength
IUnitOfLength
getTimeOverDistance
▸ getTimeOverDistance(distance
: IUnitOfLength): IUnitOfTime
Defined in Speed.ts:45
Returns the time spent traveling over the given distance
Parameters:
Name | Type |
---|---|
distance |
IUnitOfLength |
Returns: IUnitOfTime
IUnitOfTime
multiply
▸ multiply(unit
: Speed): this
Defined in Speed.ts:101
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: this
percentageOf
▸ percentageOf(unit
: Speed): this
Overrides Unit.percentageOf
Defined in Speed.ts:110
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: this
subtract
▸ subtract(unit
: Speed): this
Defined in Speed.ts:74
Parameters:
Name | Type |
---|---|
unit |
Speed |
Returns: this
toString
▸ toString(): string
Implementation of ICompoundUnit
Defined in Speed.ts:121
Returns: string