d4t_formulas/assets/formulas/formulas.d4rt

493 lines
12 KiB
Text
Raw Normal View History

2025-09-20 14:46:21 +00:00
[
// Free fall distance (vertical)
{
"name": "Free Fall Distance",
2025-10-05 14:53:46 +00:00
"description": r"""
2025-09-20 14:46:21 +00:00
Calculates vertical displacement under constant gravity
2026-02-07 15:16:00 +00:00
$$h = \frac{1}{2}gt^2$$
2025-09-20 14:46:21 +00:00
Where:
2026-02-07 15:16:00 +00:00
- $g$: Gravitational acceleration $9.81\ \mathrm{m/s^2}$ on Earth
2025-09-22 15:00:34 +00:00
- $t$: Time in free fall (seconds)
2025-09-20 14:46:21 +00:00
2025-10-05 14:53:46 +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": [
2026-02-24 09:21:07 +00:00
{"name": "t", "unit": "second"},
{"name": "g", "unit": "meters per second"}
2025-09-20 14:46:21 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "h", "unit": "meter"},
2025-09-22 15:00:34 +00:00
"d4rtCode": "h = 0.5 * g * pow(t, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "kinematics"]
},
2026-02-24 09:21:07 +00:00
2025-09-20 14:46:21 +00:00
// Newton's Law of Universal Gravitation
{
"name": "Gravitational Force",
2026-02-24 09:21:07 +00:00
"description": r"""
2025-09-20 14:46:21 +00:00
Newton's law of universal gravitation
2026-02-24 09:21:07 +00:00
$$F = G\frac{m_1m_2}{r^2}$$
2025-09-20 14:46:21 +00:00
Where:
2026-02-11 07:45:56 +00:00
- $G$: Gravitational constant $6.674\times 10^{-11}\ \mathrm{N\cdot m^2/kg^2}$
2025-09-22 15:00:34 +00:00
- $m_1, m_2$: Masses of two objects
- $r$: Distance between centers of masses
2025-09-20 14:46:21 +00:00
2026-02-24 09:21:07 +00:00
![Gravitation](https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/NewtonsLawOfUniversalGravitation.svg/1200px-NewtonsLawOfUniversalGravitation.svg.png)""",
2025-09-20 14:46:21 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "m1", "unit": "kilogram"},
{"name": "m2", "unit": "kilogram"},
{"name": "r", "unit": "meter"}
2025-09-20 14:46:21 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "F", "unit": "newton"},
2025-09-22 15:00:34 +00:00
"d4rtCode": "F = (6.67430e-11 * m1 * m2) / pow(r, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "astronomy", "gravity"]
},
2026-02-24 09:21:07 +00:00
// Projectile Motion Range
2025-09-20 14:46:21 +00:00
{
2026-02-24 09:21:07 +00:00
"name": "Projectile Range",
"description": r"""
Calculates horizontal distance of projectile motion
2025-09-20 14:46:21 +00:00
2026-02-24 09:21:07 +00:00
$$R = \frac{v^2 \sin(2\theta)}{g}$$
2025-09-20 14:46:21 +00:00
Where:
2026-02-24 09:21:07 +00:00
- $v$: Initial velocity
- $\theta$: Launch angle
- $g$: Gravitational acceleration
2025-09-20 14:46:21 +00:00
2026-02-24 09:21:07 +00:00
![Projectile Motion](https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Projectile_motion_diagram.png/800px-Projectile_motion_diagram.png)""",
2025-09-20 14:46:21 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "v", "unit": "meters per second"},
{"name": "a", "unit": "degree"}
2025-09-20 14:46:21 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "R", "unit": "meter"},
2025-09-22 15:00:34 +00:00
"d4rtCode": """
var radians = a * (pi / 180);
R = (pow(v, 2) * sin(2 * radians)) / 9.80665;
""",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "kinematics", "projectile"]
},
2026-02-24 09:21:07 +00:00
// Newton's Second Law
2025-09-20 14:46:21 +00:00
{
"name": "Newton's Second Law",
2026-02-24 09:21:07 +00:00
"description": r"""
2025-09-20 14:46:21 +00:00
Force equals mass times acceleration
2026-02-07 15:16:00 +00:00
$$F = m \cdot a$$
2025-09-20 14:46:21 +00:00
Where:
2026-02-07 15:16:00 +00:00
- $m$: Mass of object ($\mathrm{kg}$)
- $a$: Acceleration ($\mathrm{m/s^2}$)
2025-09-20 14:46:21 +00:00
2026-02-24 09:21:07 +00:00
![Newton's Second Law](https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Newtonslawsofmotion.jpg/800px-Newtonslawsofmotion.jpg)""",
2025-09-20 14:46:21 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "m", "unit": "kilogram"},
{"name": "a", "unit": "meters per square second"}
2025-09-20 14:46:21 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "F", "unit": "newton"},
2025-09-21 14:53:50 +00:00
"d4rtCode": "F = m * a;",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "mechanics", "newton"]
},
2025-11-05 11:59:11 +00:00
2026-02-07 11:52:55 +00:00
// Centripetal Force
{
"name": "Centripetal Force",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Force required to keep an object moving in circular motion
2026-02-07 15:16:00 +00:00
$$F = \frac{mv^2}{r}$$
2026-02-07 11:52:55 +00:00
Where:
- $F$: Centripetal force (Newtons)
- $m$: Mass of object (kilograms)
- $v$: Velocity (m/s)
- $r$: Radius of circular path (meters)
2026-02-24 09:21:07 +00:00
This force acts toward the center of the circle.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "m", "unit": "kilogram"},
{"name": "v", "unit": "meters per second"},
{"name": "r", "unit": "meter"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "F", "unit": "newton"},
2026-02-07 11:52:55 +00:00
"d4rtCode": "F = (m * pow(v, 2)) / r;",
"tags": ["physics", "circular motion", "centripetal"]
},
// Wave Equation
{
"name": "Wave Equation",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Relationship between wave speed, frequency, and wavelength
2026-02-07 15:16:00 +00:00
$$v = f\lambda$$
2026-02-07 11:52:55 +00:00
Where:
- $v$: Wave speed (m/s)
- $f$: Frequency (Hertz)
- $\lambda$: Wavelength (meters)
2026-02-24 09:21:07 +00:00
This applies to all types of waves including sound and light.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "f", "unit": "hertz"},
{"name": "lambda", "unit": "meter"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "v", "unit": "meters per second"},
2026-02-07 11:52:55 +00:00
"d4rtCode": "v = f * lambda;",
"tags": ["physics", "waves", "frequency"]
},
// Pythagorean Theorem
{
"name": "Pythagorean Theorem",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Fundamental relation in Euclidean geometry among the three sides of a right triangle
$$a^2 + b^2 = c^2$$
Where:
- $a$, $b$: Legs of the right triangle
- $c$: Hypotenuse of the right triangle
2026-02-24 09:21:07 +00:00
The square of the hypotenuse is equal to the sum of squares of the other two sides.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "a", "unit": "meter"},
{"name": "b", "unit": "meter"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "c", "unit": "meter"},
2026-02-07 11:52:55 +00:00
"d4rtCode": "c = sqrt(pow(a, 2) + pow(b, 2));",
"tags": ["trigonometry", "geometry", "pythagorean"]
},
// Sine Rule
{
"name": "Sine Rule",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Relationship between the sides and angles of any triangle
2026-02-07 15:16:00 +00:00
$$\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}$$
2026-02-07 11:52:55 +00:00
Where:
- $a$, $b$, $c$: Sides of the triangle
- $A$, $B$, $C$: Angles opposite to sides $a$, $b$, $c$ respectively
2026-02-24 09:21:07 +00:00
This rule is useful for solving triangles when certain combinations of angles and sides are known.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "a", "unit": "meter"},
{"name": "A", "unit": "degree"},
{"name": "B", "unit": "degree"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "b", "unit": "meter"},
2026-02-07 11:52:55 +00:00
"d4rtCode": """
var angleARad = A * (pi / 180);
var angleBRad = B * (pi / 180);
b = (a * sin(angleBRad)) / sin(angleARad);
""",
"tags": ["trigonometry", "triangle", "sine"]
},
// Cosine Rule
{
"name": "Cosine Rule",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Generalization of the Pythagorean theorem for any triangle
2026-02-07 15:16:00 +00:00
$$c^2 = a^2 + b^2 - 2ab\cos(C)$$
2026-02-07 11:52:55 +00:00
Where:
- $a$, $b$, $c$: Sides of the triangle
- $C$: Angle opposite to side $c$
2026-02-24 09:21:07 +00:00
This rule relates all three sides of a triangle to one of its angles.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "a", "unit": "meter"},
{"name": "b", "unit": "meter"},
{"name": "C", "unit": "degree"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "c", "unit": "meter"},
2026-02-07 11:52:55 +00:00
"d4rtCode": """
var angleCRad = C * (pi / 180);
c = sqrt(pow(a, 2) + pow(b, 2) - 2*a*b*cos(angleCRad));
""",
"tags": ["trigonometry", "triangle", "cosine"]
},
// Trigonometric Identity
{
"name": "Trigonometric Identity",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-07 11:52:55 +00:00
Fundamental Pythagorean identity in trigonometry
2026-02-07 15:16:00 +00:00
$$\sin^2(\theta) + \cos^2(\theta) = 1$$
2026-02-07 11:52:55 +00:00
Where:
- $\theta$: Any angle in radians or degrees
2026-02-24 09:21:07 +00:00
This identity is derived from the Pythagorean theorem applied to the unit circle.""",
2026-02-07 11:52:55 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "theta", "unit": "degree"}
2026-02-07 11:52:55 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "result", "unit": "scalar"},
2026-02-07 11:52:55 +00:00
"d4rtCode": """
var thetaRad = theta * (pi / 180);
result = pow(sin(thetaRad), 2) + pow(cos(thetaRad), 2);
""",
"tags": ["trigonometry", "identity", "sine", "cosine"]
2026-02-17 16:35:51 +00:00
},
// Gravitational Potential Energy
{
"name": "Gravitational Potential Energy",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Energy possessed by an object due to its position in a gravitational field
$$PE = mgh$$
Where:
- $m$: Mass of object (kilograms)
- $g$: Gravitational acceleration ($9.81\ \mathrm{m/s^2}$ on Earth)
- $h$: Height above reference point (meters)
2026-02-24 09:21:07 +00:00
This energy increases with height and can be converted to kinetic energy.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "m", "unit": "kilogram"},
{"name": "h", "unit": "meter"},
{"name": "g", "unit": "meters per square second"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "PE", "unit": "joule"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "PE = m * g * h;",
"tags": ["physics", "energy", "mechanics", "gravity"]
},
// Linear Momentum
{
"name": "Linear Momentum",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Quantity of motion possessed by a moving object
$$p = mv$$
Where:
- $p$: Momentum ($\mathrm{kg \cdot m/s}$)
- $m$: Mass (kilograms)
- $v$: Velocity (m/s)
2026-02-24 09:21:07 +00:00
Momentum is conserved in isolated systems.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "m", "unit": "kilogram"},
{"name": "v", "unit": "meters per second"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "p", "unit": "kilogram meter per second"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "p = m * v;",
"tags": ["physics", "mechanics", "momentum"]
},
// Volume of Sphere
{
"name": "Volume of Sphere",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Volume enclosed by a sphere
$$V = \frac{4}{3}\pi r^3$$
Where:
- $V$: Volume (cubic meters)
- $r$: Radius (meters)
- $\pi$: Pi ($\approx 3.14159$)
2026-02-24 09:21:07 +00:00
The volume is proportional to the cube of the radius.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "r", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "V", "unit": "cubic meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "V = (4.0/3.0) * pi * pow(r, 3);",
"tags": ["geometry", "sphere", "volume"]
},
// Surface Area of Sphere
{
"name": "Surface Area of Sphere",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Total surface area of a sphere
$$A = 4\pi r^2$$
Where:
- $A$: Surface area (square meters)
- $r$: Radius (meters)
- $\pi$: Pi ($\approx 3.14159$)
2026-02-24 09:21:07 +00:00
The surface area is four times the area of a circle with the same radius.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "r", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "A", "unit": "square meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "A = 4 * pi * pow(r, 2);",
"tags": ["geometry", "sphere", "surface area"]
},
// Volume of Cylinder
{
"name": "Volume of Cylinder",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Volume enclosed by a cylinder
$$V = \pi r^2 h$$
Where:
- $V$: Volume (cubic meters)
- $r$: Radius of base (meters)
- $h$: Height (meters)
- $\pi$: Pi ($\approx 3.14159$)
2026-02-24 09:21:07 +00:00
The volume is the area of the base times the height.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "r", "unit": "meter"},
{"name": "h", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "V", "unit": "cubic meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "V = pi * pow(r, 2) * h;",
"tags": ["geometry", "cylinder", "volume"]
},
// Surface Area of Cylinder
{
"name": "Surface Area of Cylinder",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Total surface area of a cylinder (including top and bottom)
$$A = 2\pi r(r + h)$$
Where:
- $A$: Total surface area (square meters)
- $r$: Radius of base (meters)
- $h$: Height (meters)
- $\pi$: Pi ($\approx 3.14159$)
2026-02-24 09:21:07 +00:00
This includes the lateral surface plus the two circular ends.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "r", "unit": "meter"},
{"name": "h", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "A", "unit": "square meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "A = 2 * pi * r * (r + h);",
"tags": ["geometry", "cylinder", "surface area"]
},
// Volume of Cone
{
"name": "Volume of Cone",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Volume enclosed by a cone
$$V = \frac{1}{3}\pi r^2 h$$
Where:
- $V$: Volume (cubic meters)
- $r$: Radius of base (meters)
- $h$: Height (meters)
- $\pi$: Pi ($\approx 3.14159$)
2026-02-24 09:21:07 +00:00
The volume is one-third the volume of a cylinder with the same base and height.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "r", "unit": "meter"},
{"name": "h", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "V", "unit": "cubic meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "V = (1.0/3.0) * pi * pow(r, 2) * h;",
"tags": ["geometry", "cone", "volume"]
},
// Volume of Cube
{
"name": "Volume of Cube",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Volume enclosed by a cube
$$V = s^3$$
Where:
- $V$: Volume (cubic meters)
- $s$: Side length (meters)
2026-02-24 09:21:07 +00:00
The volume is the cube of the side length.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "s", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "V", "unit": "cubic meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "V = pow(s, 3);",
"tags": ["geometry", "cube", "volume"]
},
// Surface Area of Cube
{
"name": "Surface Area of Cube",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Total surface area of a cube
$$A = 6s^2$$
Where:
- $A$: Total surface area (square meters)
- $s$: Side length (meters)
2026-02-24 09:21:07 +00:00
The surface area is six times the area of one face.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "s", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "A", "unit": "square meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "A = 6 * pow(s, 2);",
"tags": ["geometry", "cube", "surface area"]
},
// Perimeter of Rectangle
{
"name": "Perimeter of Rectangle",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Total distance around a rectangle
$$P = 2(l + w)$$
Where:
- $P$: Perimeter (meters)
- $l$: Length (meters)
- $w$: Width (meters)
2026-02-24 09:21:07 +00:00
The perimeter is twice the sum of length and width.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "l", "unit": "meter"},
{"name": "w", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "P", "unit": "meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "P = 2 * (l + w);",
"tags": ["geometry", "rectangle", "perimeter"]
},
// Perimeter of Triangle
{
"name": "Perimeter of Triangle",
2026-02-24 09:21:07 +00:00
"description": r"""
2026-02-17 16:35:51 +00:00
Total distance around a triangle
$$P = a + b + c$$
Where:
- $P$: Perimeter (meters)
- $a, b, c$: Side lengths (meters)
2026-02-24 09:21:07 +00:00
The perimeter is the sum of all three sides.""",
2026-02-17 16:35:51 +00:00
"input": [
2026-02-24 09:21:07 +00:00
{"name": "a", "unit": "meter"},
{"name": "b", "unit": "meter"},
{"name": "c", "unit": "meter"}
2026-02-17 16:35:51 +00:00
],
2026-02-24 09:21:07 +00:00
"output": {"name": "P", "unit": "meter"},
2026-02-17 16:35:51 +00:00
"d4rtCode": "P = a + b + c;",
"tags": ["geometry", "triangle", "perimeter"]
2026-02-07 11:52:55 +00:00
}
2025-09-20 14:46:21 +00:00
]