feat: add angle units and formula documentation
This commit is contained in:
parent
ba5175b6be
commit
c497633cac
3 changed files with 52 additions and 1 deletions
|
|
@ -2,6 +2,16 @@
|
|||
// Free fall distance (vertical)
|
||||
{
|
||||
name: "Free Fall Distance",
|
||||
description: '''
|
||||
Calculates vertical displacement under constant gravity
|
||||
|
||||
`h = ½gt²`
|
||||
|
||||
Where:
|
||||
- `g` = Gravitational acceleration (9.81 m/s² on Earth)
|
||||
- `t` = Time in free fall (seconds)
|
||||
|
||||
''',
|
||||
input: [
|
||||
{name: "t", magnitude: "s"}, // Time in seconds
|
||||
{name: "g", magnitude: "m/s²"} // Gravitational acceleration
|
||||
|
|
@ -13,6 +23,17 @@
|
|||
// Newton's Law of Universal Gravitation
|
||||
{
|
||||
name: "Gravitational Force",
|
||||
description: '''
|
||||
Newton's law of universal gravitation
|
||||
|
||||
`F = G(m₁m₂)/r²`
|
||||
|
||||
Where:
|
||||
- `G` = Gravitational constant (6.674×10⁻¹¹ N·m²/kg²)
|
||||
- `m₁`, `m₂` = Masses of two objects
|
||||
- `r` = Distance between centers of masses
|
||||
|
||||
''',
|
||||
input: [
|
||||
{name: "m1", magnitude: "kg"}, // Mass 1
|
||||
{name: "m2", magnitude: "kg"}, // Mass 2
|
||||
|
|
@ -25,6 +46,16 @@
|
|||
// Kinetic Energy
|
||||
{
|
||||
name: "Kinetic Energy",
|
||||
description: '''
|
||||
Energy possessed by a moving object
|
||||
|
||||
`KE = ½mv²`
|
||||
|
||||
Where:
|
||||
- `m` = Mass of object
|
||||
- `v` = Velocity of object
|
||||
|
||||
''',
|
||||
input: [
|
||||
{name: "m", magnitude: "kg"}, // Mass
|
||||
{name: "v", magnitude: "m/s"} // Velocity
|
||||
|
|
@ -36,6 +67,13 @@
|
|||
// Projectile Motion Range
|
||||
{
|
||||
name: "Projectile Range",
|
||||
description: "Calculates horizontal distance of projectile motion\n\n"
|
||||
"`R = (v² sin(2θ))/g`\n\n"
|
||||
"Where:\n"
|
||||
"- `v` = Initial velocity\n"
|
||||
"- `θ` = Launch angle\n"
|
||||
"- `g` = Gravitational acceleration\n\n"
|
||||
"",
|
||||
input: [
|
||||
{name: "v", magnitude: "m/s"}, // Initial velocity
|
||||
{name: "θ", magnitude: "deg"} // Launch angle
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ Future<UnitCorpus> createTestCorpus() async {
|
|||
"lib/units/pressure.d4rt.units",
|
||||
"lib/units/temperature.d4rt.units",
|
||||
"lib/units/velocity.d4rt.units",
|
||||
"lib/units/mass.d4rt.units"
|
||||
"lib/units/mass.d4rt.units",
|
||||
"lib/units/angle.d4rt.units"
|
||||
];
|
||||
|
||||
for (final resourcePath in resources) {
|
||||
|
|
|
|||
12
lib/units/angle.d4rt.units
Normal file
12
lib/units/angle.d4rt.units
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[
|
||||
{"name": "radian", "symbol": "rad", "isBase": true},
|
||||
{"name": "degree", "symbol": "°", "baseUnit": "radian", "factor": 0.017453292519943295},
|
||||
{"name": "gradian", "symbol": "gon", "baseUnit": "radian", "factor": 0.015707963267948967},
|
||||
{"name": "revolution", "symbol": "rev", "baseUnit": "radian", "factor": 6.283185307179586},
|
||||
{"name": "arcminute", "symbol": "'", "baseUnit": "radian", "factor": 0.0002908882086657216},
|
||||
{"name": "arcsecond", "symbol": "\"", "baseUnit": "radian", "factor": 0.00000484813681109536},
|
||||
{"name": "binary degree", "symbol": "brad", "baseUnit": "radian", "factor": 0.02454369260617026},
|
||||
{"name": "quadrant", "symbol": "quad", "baseUnit": "radian", "factor": 1.5707963267948966},
|
||||
{"name": "sextant", "symbol": "sextant", "baseUnit": "radian", "factor": 1.0471975511965976},
|
||||
{"name": "octant", "symbol": "octant", "baseUnit": "radian", "factor": 0.7853981633974483}
|
||||
]
|
||||
Loading…
Reference in a new issue