@quenty/metricutils 2.1.0-canary.241.a4e8214.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -2
- package/package.json +2 -2
- package/src/Shared/MetricUtils.lua +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [2.1.0
|
|
6
|
+
# [2.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/metricutils@2.0.1...@quenty/metricutils@2.1.0) (2022-01-03)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
-
* Add MetricUtils.
|
|
11
|
+
* Add MetricUtils.kphToStudsPerSecond(kph) and MetricUtils.mphToStudsPerSecond(mph) ([23c4c96](https://github.com/Quenty/NevermoreEngine/commit/23c4c96158a582b30f13d58ebb8b9f8139aca130))
|
|
12
|
+
* Add MetricUtils.studsPerSecondToKph(studsPerSecond) and MetricUtils.studsPerSecondToMph(studsPerSecond) ([a833467](https://github.com/Quenty/NevermoreEngine/commit/a833467c4f970604f9c32aee8effe064cf884c90))
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/metricutils",
|
|
3
|
-
"version": "2.1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Provides ways to convert to or from metric",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d910da8f5c7e9a55a8bf76d8efbe5632713dd0fe"
|
|
31
31
|
}
|
|
@@ -56,4 +56,22 @@ function MetricUtils.studsPerSecondToMph(studsPerSecond)
|
|
|
56
56
|
return studsPerSecond/STUDS_PER_METER/1000*SECONDS_PER_HOUR*KPH_TO_MPH
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
--[=[
|
|
60
|
+
Convert mph to studs per a second
|
|
61
|
+
@param kph number
|
|
62
|
+
@return number -- studs per a second
|
|
63
|
+
]=]
|
|
64
|
+
function MetricUtils.kphToStudsPerSecond(kph)
|
|
65
|
+
return kph*STUDS_PER_METER*1000/SECONDS_PER_HOUR
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
--[=[
|
|
69
|
+
Convert mph to studs per a second
|
|
70
|
+
@param mph number
|
|
71
|
+
@return number -- studs per a second
|
|
72
|
+
]=]
|
|
73
|
+
function MetricUtils.mphToStudsPerSecond(mph)
|
|
74
|
+
return mph*STUDS_PER_METER*1000/SECONDS_PER_HOUR/KPH_TO_MPH
|
|
75
|
+
end
|
|
76
|
+
|
|
59
77
|
return MetricUtils
|