d4t_formulas/lib/defaults/formulas.d4rt

110 lines
3.6 KiB
Text
Raw Normal View History

2025-09-20 14:46:21 +00:00
[
// 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)
2025-09-21 14:53:50 +00:00
![Free Fall Diagram](https://altcalculator.com/wp-content/uploads/2023/08/Free-Fall.png)''',
2025-09-20 14:46:21 +00:00
"input": [
{"name": "t", "unit": "second"}, // Time in seconds
{"name": "g", "unit": "meters per second"} // Gravitational acceleration
2025-09-20 14:46:21 +00:00
],
"output": {"name": "h", "unit": "meter"}, // Height in meters
"d4rtCode": "h = 0.5 * g * Math.pow(t, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "kinematics"]
},
// 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
![Gravitation](https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/NewtonsLawOfUniversalGravitation.svg/1200px-NewtonsLawOfUniversalGravitation.svg.png)''',
"input": [
{"name": "m1", "unit": "kilogram"}, // Mass 1
{"name": "m2", "unit": "kilogram"}, // Mass 2
{"name": "r", "unit": "meter"} // Distance between masses
2025-09-20 14:46:21 +00:00
],
"output": {"name": "F", "unit": "newton"}, // Force in newtons
"d4rtCode": "F = (6.67430e-11 * m1 * m2) / Math.pow(r, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "astronomy", "gravity"]
},
// Kinetic Energy
{
"name": "Kinetic Energy",
"description": '''
Energy possessed by a moving object
`KE = ½mv²`
Where:
- `m` = Mass of object
- `v` = Velocity of object
![Kinetic Energy](https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Kinetic_energy.svg/1200px-Kinetic_energy.svg.png)''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "v", "unit": "meters per second"} // Velocity
2025-09-20 14:46:21 +00:00
],
"output": {"name": "KE", "unit": "joule"}, // Energy in joules
"d4rtCode": "KE = 0.5 * m * Math.pow(v, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "energy", "mechanics"]
},
// 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"
"![Projectile Motion](https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Projectile_motion_diagram.png/800px-Projectile_motion_diagram.png)",
"input": [
{"name": "v", "unit": "meters per second"}, // Initial velocity
{"name": "θ", "unit": "degree"} // Launch angle
2025-09-20 14:46:21 +00:00
],
"output": {"name": "R", "unit": "meter"}, // Horizontal distance
"d4rtCode": "R = (Math.pow(v, 2) * sin(2 * radians(θ))) / 9.80665;",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "kinematics", "projectile"]
},
{
"name": "Newton's Second Law",
"description": '''
Force equals mass times acceleration
`F = m * a`
Where:
- `m` = Mass of object (kg)
- `a` = Acceleration (m/s²)
![Newton's Second Law](https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Newtonslawsofmotion.jpg/800px-Newtonslawsofmotion.jpg)''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "a", "unit": "meters per square second"} // Acceleration
2025-09-20 14:46:21 +00:00
],
"output": {"name": "F", "unit": "newton"}, // Force in newtons
2025-09-21 14:53:50 +00:00
"d4rtCode": "F = m * a;",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "mechanics", "newton"]
},
]