2025-09-20 14:46:21 +00:00
[
2025-10-13 14:31:26 +00:00
{
"name": "Temperature converter",
"description": "Example of simple formula, just unit conversion",
"input": [
2025-10-14 17:21:35 +00:00
{"name": "Input", "unit": "Kelvin" }
2025-10-13 14:31:26 +00:00
],
"output": {"name": "Output", "unit": "Kelvin" },
"d4rtCode": "Output = Input;",
"tags": ["converter", "temperature" ]
},
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
""",
2025-09-20 14:46:21 +00:00
"input": [
{"name": "t", "unit": "second"}, // Time in seconds
2025-09-21 14:35:54 +00:00
{"name": "g", "unit": "meters per second"} // Gravitational acceleration
2025-09-20 14:46:21 +00:00
],
2025-09-21 14:35:54 +00:00
"output": {"name": "h", "unit": "meter"}, // Height in meters
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"]
},
// Newton's Law of Universal Gravitation
{
"name": "Gravitational Force",
2025-10-05 14:53:46 +00:00
"description": r'''
2025-09-20 14:46:21 +00:00
Newton's law of universal gravitation
2026-02-07 15:16:00 +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
''',
"input": [
2025-09-21 14:35:54 +00:00
{"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
],
2025-09-21 14:35:54 +00:00
"output": {"name": "F", "unit": "newton"}, // Force in newtons
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"]
},
// Kinetic Energy
{
"name": "Kinetic Energy",
2025-10-05 14:53:46 +00:00
"description": r'''
2025-09-20 14:46:21 +00:00
Energy possessed by a moving object
2026-02-07 15:16:00 +00:00
$$KE = \frac{1}{2}mv^2$$
2025-09-20 14:46:21 +00:00
Where:
2025-09-22 15:00:34 +00:00
- $m$: Mass of object
- $v$: Velocity of object
2025-09-20 14:46:21 +00:00
''',
"input": [
2025-09-21 14:35:54 +00:00
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "v", "unit": "meters per second"} // Velocity
2025-09-20 14:46:21 +00:00
],
2025-09-21 14:35:54 +00:00
"output": {"name": "KE", "unit": "joule"}, // Energy in joules
2025-09-22 15:00:34 +00:00
"d4rtCode": "KE = 0.5 * m * pow(v, 2);",
2025-09-20 14:46:21 +00:00
"tags": ["physics", "energy", "mechanics"]
},
// Projectile Motion Range
{
"name": "Projectile Range",
2025-10-05 14:53:46 +00:00
"description": r"""Calculates horizontal distance of projectile motion
2026-02-07 15:16:00 +00:00
$$R = \frac{v^2 \sin(2\theta)}{g}$$
2025-10-05 14:53:46 +00:00
Where:
- $v$: Initial velocity
2026-02-07 15:16:00 +00:00
- $\theta$: Launch angle
2025-10-05 14:53:46 +00:00
- $g$: Gravitational acceleration
""",
2025-09-20 14:46:21 +00:00
"input": [
2025-09-21 14:35:54 +00:00
{"name": "v", "unit": "meters per second"}, // Initial velocity
2025-09-22 15:00:34 +00:00
{"name": "a", "unit": "degree"} // Launch angle
2025-09-20 14:46:21 +00:00
],
2025-09-21 14:44:48 +00:00
"output": {"name": "R", "unit": "meter"}, // Horizontal distance
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"]
},
{
"name": "Newton's Second Law",
2025-10-05 14:53:46 +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
''',
"input": [
2025-09-21 14:35:54 +00:00
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "a", "unit": "meters per square second"} // Acceleration
2025-09-20 14:46:21 +00:00
],
2025-09-21 14:35:54 +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"]
},
2025-11-05 11:59:11 +00:00
// Apgar Score
{
"name": "Apgar Score",
"description": "Newborn health assessment scoring system\n\nScores 0-2 for:\n1. Heart rate\n2. Breathing\n3. Muscle tone\n4. Reflexes\n5. Skin color\nTotal score 0-10",
"input": [
2026-01-25 17:39:43 +00:00
{"name": "HeartRate", "values": ["Absent", "< 100 bpm>", "> 100 bpm"] },
{"name": "Breathing", "values": ["Absent", "Weak, irregular", "Strong, robust cry"] },
{"name": "MuscleTone", "values": ["None", "Some", "Flexed arms/leg, resists extension"] },
{"name": "Reflexes", "values": ["No response", "Grimace on aggressive stimulation", "Cry on stimulation"] },
{"name": "SkinColor", "values": ["Blue or pale", "Blue extremities, pink body", "Pink"] }
2025-11-05 11:59:11 +00:00
],
2026-01-31 18:53:12 +00:00
"output": {"name": "Result", "unit": "string"},
2025-11-05 11:59:11 +00:00
"d4rtCode": """
2026-01-31 18:53:12 +00:00
var total = indexOf("HeartRate") + indexOf("Breathing") + indexOf("MuscleTone") + indexOf("Reflexes") + indexOf("SkinColor");
2026-01-25 18:03:57 +00:00
late var interpretation;
if( total < 4 ) {
interpretation = 'Critical condition';
}
else if( total < 7 ){
interpretation = 'Needs assistance';
}
else {
interpretation = 'Normal';
}
2025-11-05 11:59:11 +00:00
Result = 'Score: \$total - \$interpretation';
""",
"tags": ["medical", "pediatrics", "assessment"]
}
2026-01-28 10:04:33 +00:00
,
{
"name": "Compare price per mass",
2026-02-07 11:39:26 +00:00
"description": "Compares two products by their price per mass and returns which is cheaper, including price per kg for each product.",
2026-01-28 10:04:33 +00:00
"input": [
2026-01-31 18:53:12 +00:00
{"name": "price1", "unit": "currency"},
2026-01-28 10:04:33 +00:00
{"name": "mass1", "unit": "kilogram"},
2026-01-31 18:53:12 +00:00
{"name": "price2", "unit": "currency"},
2026-01-28 10:04:33 +00:00
{"name": "mass2", "unit": "kilogram"}
],
2026-01-31 18:53:12 +00:00
"output": {"name": "Result", "unit": "string"},
2026-01-28 10:04:33 +00:00
"d4rtCode": """
var p1 = price1 / mass1;
var p2 = price2 / mass2;
if (p1 < p2) {
2026-02-07 11:39:26 +00:00
Result = 'first product is cheaper at \${p1.toStringAsFixed(2)} currency/kg vs \${p2.toStringAsFixed(2)} currency/kg';
2026-01-28 10:04:33 +00:00
} else if (p2 < p1) {
2026-02-07 11:39:26 +00:00
Result = 'second product is cheaper at \${p2.toStringAsFixed(2)} currency/kg vs \${p1.toStringAsFixed(2)} currency/kg';
2026-01-28 10:04:33 +00:00
} else {
2026-02-07 11:39:26 +00:00
Result = 'both products have the same price per mass at \${p1.toStringAsFixed(2)} currency/kg';
2026-01-28 10:04:33 +00:00
}
""",
"tags": ["comparison", "shopping", "economics"]
}
2026-02-07 11:52:55 +00:00
,
// Einstein's Mass-Energy Equivalence
{
"name": "Mass-Energy Equivalence",
"description": r'''
Einstein's famous equation showing the relationship between mass and energy
$$E = mc^2$$
Where:
- $E$: Energy (Joules)
- $m$: Mass (kilograms)
2026-02-07 15:16:00 +00:00
- $c$: Speed of light $299,792,458$ $\mathrm{m/s}$
2026-02-07 11:52:55 +00:00
This equation shows that mass can be converted to energy and vice versa.''',
"input": [
{"name": "m", "unit": "kilogram"} // Mass
],
"output": {"name": "E", "unit": "joule"}, // Energy
"d4rtCode": "E = m * pow(299792458, 2);",
"tags": ["physics", "relativity", "energy"]
},
// Ohm's Law
{
"name": "Ohm's Law",
"description": r'''
Relationship between voltage, current, and resistance in electrical circuits
$$V = IR$$
Where:
- $V$: Voltage (Volts)
- $I$: Current (Amperes)
- $R$: Resistance (Ohms)
This fundamental law describes how current flows through resistive materials.''',
"input": [
{"name": "I", "unit": "ampere"}, // Current
{"name": "R", "unit": "ohm"} // Resistance
],
"output": {"name": "V", "unit": "volt"}, // Voltage
"d4rtCode": "V = I * R;",
"tags": ["physics", "electricity", "electronics"]
},
// Hooke's Law
{
"name": "Hooke's Law",
"description": r'''
Force exerted by a spring is proportional to its displacement
$$F = -kx$$
Where:
- $F$: Restoring force (Newtons)
- $k$: Spring constant (N/m)
- $x$: Displacement from equilibrium (meters)
The negative sign indicates the force opposes the displacement.''',
"input": [
{"name": "k", "unit": "newton per meter"}, // Spring constant
{"name": "x", "unit": "meter"} // Displacement
],
"output": {"name": "F", "unit": "newton"}, // Force
"d4rtCode": "F = -k * x;",
"tags": ["physics", "elasticity", "oscillations"]
},
// Centripetal Force
{
"name": "Centripetal Force",
"description": r'''
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)
This force acts toward the center of the circle.''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "v", "unit": "meters per second"}, // Velocity
{"name": "r", "unit": "meter"} // Radius
],
"output": {"name": "F", "unit": "newton"}, // Force
"d4rtCode": "F = (m * pow(v, 2)) / r;",
"tags": ["physics", "circular motion", "centripetal"]
},
// Wave Equation
{
"name": "Wave Equation",
"description": r'''
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)
This applies to all types of waves including sound and light.''',
"input": [
{"name": "f", "unit": "hertz"}, // Frequency
{"name": "lambda", "unit": "meter"} // Wavelength
],
"output": {"name": "v", "unit": "meters per second"}, // Wave speed
"d4rtCode": "v = f * lambda;",
"tags": ["physics", "waves", "frequency"]
},
// Pythagorean Theorem
{
"name": "Pythagorean Theorem",
"description": r'''
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
The square of the hypotenuse is equal to the sum of squares of the other two sides.''',
"input": [
{"name": "a", "unit": "meter"}, // First leg
{"name": "b", "unit": "meter"} // Second leg
],
"output": {"name": "c", "unit": "meter"}, // Hypotenuse
"d4rtCode": "c = sqrt(pow(a, 2) + pow(b, 2));",
"tags": ["trigonometry", "geometry", "pythagorean"]
},
// Sine Rule
{
"name": "Sine Rule",
"description": r'''
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
This rule is useful for solving triangles when certain combinations of angles and sides are known.''',
"input": [
{"name": "a", "unit": "meter"}, // Side a
{"name": "A", "unit": "degree"}, // Angle A in degrees
{"name": "B", "unit": "degree"} // Angle B in degrees
],
"output": {"name": "b", "unit": "meter"}, // Side b
"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",
"description": r'''
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$
This rule relates all three sides of a triangle to one of its angles.''',
"input": [
{"name": "a", "unit": "meter"}, // Side a
{"name": "b", "unit": "meter"}, // Side b
{"name": "C", "unit": "degree"} // Angle C in degrees
],
"output": {"name": "c", "unit": "meter"}, // Side c
"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",
"description": r'''
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
This identity is derived from the Pythagorean theorem applied to the unit circle.''',
"input": [
{"name": "theta", "unit": "degree"} // Angle in degrees
],
"output": {"name": "result", "unit": "scalar"}, // Result (should be 1)
"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",
"description": r'''
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)
This energy increases with height and can be converted to kinetic energy.''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "h", "unit": "meter"}, // Height
{"name": "g", "unit": "meters per square second"} // Gravitational acceleration
],
"output": {"name": "PE", "unit": "joule"}, // Potential energy
"d4rtCode": "PE = m * g * h;",
"tags": ["physics", "energy", "mechanics", "gravity"]
},
// Linear Momentum
{
"name": "Linear Momentum",
"description": r'''
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)
Momentum is conserved in isolated systems.''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "v", "unit": "meters per second"} // Velocity
],
"output": {"name": "p", "unit": "kilogram meter per second"}, // Momentum
"d4rtCode": "p = m * v;",
"tags": ["physics", "mechanics", "momentum"]
},
// Density
{
"name": "Density",
"description": r'''
Mass per unit volume of a substance
$$\rho = \frac{m}{V}$$
Where:
- $\rho$: Density ($\mathrm{kg/m^3}$)
- $m$: Mass (kilograms)
- $V$: Volume (cubic meters)
Density is an intrinsic property of materials.''',
"input": [
{"name": "m", "unit": "kilogram"}, // Mass
{"name": "V", "unit": "cubic meter"} // Volume
],
"output": {"name": "rho", "unit": "kilogram per cubic meter"}, // Density
"d4rtCode": "rho = m / V;",
"tags": ["physics", "mechanics", "material"]
},
// Pressure
{
"name": "Pressure",
"description": r'''
Force applied perpendicular to a surface per unit area
$$P = \frac{F}{A}$$
Where:
- $P$: Pressure (Pascals)
- $F$: Force (Newtons)
- $A$: Area (square meters)
Pressure is transmitted equally in all directions in fluids.''',
"input": [
{"name": "F", "unit": "newton"}, // Force
{"name": "A", "unit": "square meter"} // Area
],
"output": {"name": "P", "unit": "pascal"}, // Pressure
"d4rtCode": "P = F / A;",
"tags": ["physics", "mechanics", "fluid"]
},
// Work
{
"name": "Work",
"description": r'''
Energy transferred when a force moves an object
$$W = Fd\cos(\theta)$$
Where:
- $W$: Work (Joules)
- $F$: Force (Newtons)
- $d$: Displacement (meters)
- $\theta$: Angle between force and displacement
Maximum work occurs when force and displacement are parallel.''',
"input": [
{"name": "F", "unit": "newton"}, // Force
{"name": "d", "unit": "meter"}, // Displacement
{"name": "theta", "unit": "degree"} // Angle
],
"output": {"name": "W", "unit": "joule"}, // Work
"d4rtCode": """
var thetaRad = theta * (pi / 180);
W = F * d * cos(thetaRad);
""",
"tags": ["physics", "energy", "mechanics"]
},
// Power
{
"name": "Power",
"description": r'''
Rate at which work is done or energy is transferred
$$P = \frac{W}{t}$$
Where:
- $P$: Power (Watts)
- $W$: Work or Energy (Joules)
- $t$: Time (seconds)
Power measures how quickly energy is used or transferred.''',
"input": [
{"name": "W", "unit": "joule"}, // Work or Energy
{"name": "t", "unit": "second"} // Time
],
"output": {"name": "P", "unit": "watt"}, // Power
"d4rtCode": "P = W / t;",
"tags": ["physics", "energy", "mechanics"]
},
// Coulomb's Law
{
"name": "Coulomb's Law",
"description": r'''
Force between two electrically charged particles
$$F = k_e\frac{q_1q_2}{r^2}$$
Where:
- $F$: Electrostatic force (Newtons)
- $k_e$: Coulomb's constant $8.988\times 10^9\ \mathrm{N\cdot m^2/C^2}$
- $q_1, q_2$: Electric charges (Coulombs)
- $r$: Distance between charges (meters)
Like charges repel, opposite charges attract.''',
"input": [
{"name": "q1", "unit": "coulomb"}, // Charge 1
{"name": "q2", "unit": "coulomb"}, // Charge 2
{"name": "r", "unit": "meter"} // Distance
],
"output": {"name": "F", "unit": "newton"}, // Force
"d4rtCode": "F = (8.9875517923e9 * q1 * q2) / pow(r, 2);",
"tags": ["physics", "electricity", "electrostatics"]
},
// Electric Power
{
"name": "Electric Power",
"description": r'''
Rate at which electrical energy is transferred
$$P = VI$$
Where:
- $P$: Power (Watts)
- $V$: Voltage (Volts)
- $I$: Current (Amperes)
This formula is fundamental in electrical circuit analysis.''',
"input": [
{"name": "V", "unit": "volt"}, // Voltage
{"name": "I", "unit": "ampere"} // Current
],
"output": {"name": "P", "unit": "watt"}, // Power
"d4rtCode": "P = V * I;",
"tags": ["physics", "electricity", "electronics"]
},
// Ideal Gas Law
{
"name": "Ideal Gas Law",
"description": r'''
Equation of state for an ideal gas
$$PV = nRT$$
Where:
- $P$: Pressure (Pascals)
- $V$: Volume (cubic meters)
- $n$: Amount of substance (moles)
- $R$: Universal gas constant $8.314\ \mathrm{J/(mol\cdot K)}$
- $T$: Temperature (Kelvin)
This law combines Boyle's, Charles's, and Avogadro's laws.''',
"input": [
{"name": "n", "unit": "mole"}, // Amount of substance
{"name": "T", "unit": "kelvin"}, // Temperature
{"name": "V", "unit": "cubic meter"} // Volume
],
"output": {"name": "P", "unit": "pascal"}, // Pressure
"d4rtCode": "P = (n * 8.314462618 * T) / V;",
"tags": ["physics", "thermodynamics", "gas"]
},
// Snell's Law
{
"name": "Snell's Law",
"description": r'''
Law describing refraction of light at interface between media
$$n_1\sin(\theta_1) = n_2\sin(\theta_2)$$
Where:
- $n_1, n_2$: Refractive indices of the two media
- $\theta_1$: Angle of incidence
- $\theta_2$: Angle of refraction
This law explains how light bends when passing between materials.''',
"input": [
{"name": "n1", "unit": "scalar"}, // Refractive index 1
{"name": "n2", "unit": "scalar"}, // Refractive index 2
{"name": "theta1", "unit": "degree"} // Angle of incidence
],
"output": {"name": "theta2", "unit": "degree"}, // Angle of refraction
"d4rtCode": """
var theta1Rad = theta1 * (pi / 180);
var sinTheta2 = (n1 * sin(theta1Rad)) / n2;
theta2 = asin(sinTheta2) * (180 / pi);
""",
"tags": ["physics", "optics", "light"]
},
// Buoyant Force (Archimedes' Principle)
{
"name": "Buoyant Force",
"description": r'''
Upward force exerted on an object immersed in a fluid
$$F_b = \rho g V$$
Where:
- $F_b$: Buoyant force (Newtons)
- $\rho$: Fluid density ($\mathrm{kg/m^3}$)
- $g$: Gravitational acceleration ($\mathrm{m/s^2}$)
- $V$: Displaced volume (cubic meters)
An object floats when buoyant force equals its weight.''',
"input": [
{"name": "rho", "unit": "kilogram per cubic meter"}, // Fluid density
{"name": "g", "unit": "meters per square second"}, // Gravitational acceleration
{"name": "V", "unit": "cubic meter"} // Displaced volume
],
"output": {"name": "Fb", "unit": "newton"}, // Buoyant force
"d4rtCode": "Fb = rho * g * V;",
"tags": ["physics", "fluid", "mechanics"]
},
// Area of Circle
{
"name": "Area of Circle",
"description": r'''
Area enclosed by a circle
$$A = \pi r^2$$
Where:
- $A$: Area (square meters)
- $r$: Radius (meters)
- $\pi$: Pi ($\approx 3.14159$)
The area is proportional to the square of the radius.''',
"input": [
{"name": "r", "unit": "meter"} // Radius
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": "A = pi * pow(r, 2);",
"tags": ["geometry", "circle", "area"]
},
// Circumference of Circle
{
"name": "Circumference of Circle",
"description": r'''
Perimeter (distance around) a circle
$$C = 2\pi r$$
Where:
- $C$: Circumference (meters)
- $r$: Radius (meters)
- $\pi$: Pi ($\approx 3.14159$)
The circumference is proportional to the radius.''',
"input": [
{"name": "r", "unit": "meter"} // Radius
],
"output": {"name": "C", "unit": "meter"}, // Circumference
"d4rtCode": "C = 2 * pi * r;",
"tags": ["geometry", "circle", "perimeter"]
},
// Area of Triangle
{
"name": "Area of Triangle",
"description": r'''
Area enclosed by a triangle
$$A = \frac{1}{2}bh$$
Where:
- $A$: Area (square meters)
- $b$: Base length (meters)
- $h$: Height perpendicular to base (meters)
This formula works for any triangle.''',
"input": [
{"name": "b", "unit": "meter"}, // Base
{"name": "h", "unit": "meter"} // Height
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": "A = 0.5 * b * h;",
"tags": ["geometry", "triangle", "area"]
},
// Area of Rectangle
{
"name": "Area of Rectangle",
"description": r'''
Area enclosed by a rectangle
$$A = lw$$
Where:
- $A$: Area (square meters)
- $l$: Length (meters)
- $w$: Width (meters)
The area is the product of length and width.''',
"input": [
{"name": "l", "unit": "meter"}, // Length
{"name": "w", "unit": "meter"} // Width
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": "A = l * w;",
"tags": ["geometry", "rectangle", "area"]
},
// Area of Trapezoid
{
"name": "Area of Trapezoid",
"description": r'''
Area enclosed by a trapezoid
$$A = \frac{1}{2}(a+b)h$$
Where:
- $A$: Area (square meters)
- $a, b$: Lengths of parallel sides (meters)
- $h$: Height (perpendicular distance between parallel sides, meters)
The area is the average of parallel sides times height.''',
"input": [
{"name": "a", "unit": "meter"}, // Parallel side 1
{"name": "b", "unit": "meter"}, // Parallel side 2
{"name": "h", "unit": "meter"} // Height
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": "A = 0.5 * (a + b) * h;",
"tags": ["geometry", "trapezoid", "area"]
},
// Volume of Sphere
{
"name": "Volume of Sphere",
"description": r'''
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$)
The volume is proportional to the cube of the radius.''',
"input": [
{"name": "r", "unit": "meter"} // Radius
],
"output": {"name": "V", "unit": "cubic meter"}, // Volume
"d4rtCode": "V = (4.0/3.0) * pi * pow(r, 3);",
"tags": ["geometry", "sphere", "volume"]
},
// Surface Area of Sphere
{
"name": "Surface Area of Sphere",
"description": r'''
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$)
The surface area is four times the area of a circle with the same radius.''',
"input": [
{"name": "r", "unit": "meter"} // Radius
],
"output": {"name": "A", "unit": "square meter"}, // Surface area
"d4rtCode": "A = 4 * pi * pow(r, 2);",
"tags": ["geometry", "sphere", "surface area"]
},
// Volume of Cylinder
{
"name": "Volume of Cylinder",
"description": r'''
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$)
The volume is the area of the base times the height.''',
"input": [
{"name": "r", "unit": "meter"}, // Radius
{"name": "h", "unit": "meter"} // Height
],
"output": {"name": "V", "unit": "cubic meter"}, // Volume
"d4rtCode": "V = pi * pow(r, 2) * h;",
"tags": ["geometry", "cylinder", "volume"]
},
// Surface Area of Cylinder
{
"name": "Surface Area of Cylinder",
"description": r'''
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$)
This includes the lateral surface plus the two circular ends.''',
"input": [
{"name": "r", "unit": "meter"}, // Radius
{"name": "h", "unit": "meter"} // Height
],
"output": {"name": "A", "unit": "square meter"}, // Surface area
"d4rtCode": "A = 2 * pi * r * (r + h);",
"tags": ["geometry", "cylinder", "surface area"]
},
// Volume of Cone
{
"name": "Volume of Cone",
"description": r'''
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$)
The volume is one-third the volume of a cylinder with the same base and height.''',
"input": [
{"name": "r", "unit": "meter"}, // Radius
{"name": "h", "unit": "meter"} // Height
],
"output": {"name": "V", "unit": "cubic meter"}, // Volume
"d4rtCode": "V = (1.0/3.0) * pi * pow(r, 2) * h;",
"tags": ["geometry", "cone", "volume"]
},
// Volume of Cube
{
"name": "Volume of Cube",
"description": r'''
Volume enclosed by a cube
$$V = s^3$$
Where:
- $V$: Volume (cubic meters)
- $s$: Side length (meters)
The volume is the cube of the side length.''',
"input": [
{"name": "s", "unit": "meter"} // Side length
],
"output": {"name": "V", "unit": "cubic meter"}, // Volume
"d4rtCode": "V = pow(s, 3);",
"tags": ["geometry", "cube", "volume"]
},
// Surface Area of Cube
{
"name": "Surface Area of Cube",
"description": r'''
Total surface area of a cube
$$A = 6s^2$$
Where:
- $A$: Total surface area (square meters)
- $s$: Side length (meters)
The surface area is six times the area of one face.''',
"input": [
{"name": "s", "unit": "meter"} // Side length
],
"output": {"name": "A", "unit": "square meter"}, // Surface area
"d4rtCode": "A = 6 * pow(s, 2);",
"tags": ["geometry", "cube", "surface area"]
},
// Perimeter of Rectangle
{
"name": "Perimeter of Rectangle",
"description": r'''
Total distance around a rectangle
$$P = 2(l + w)$$
Where:
- $P$: Perimeter (meters)
- $l$: Length (meters)
- $w$: Width (meters)
The perimeter is twice the sum of length and width.''',
"input": [
{"name": "l", "unit": "meter"}, // Length
{"name": "w", "unit": "meter"} // Width
],
"output": {"name": "P", "unit": "meter"}, // Perimeter
"d4rtCode": "P = 2 * (l + w);",
"tags": ["geometry", "rectangle", "perimeter"]
},
// Perimeter of Triangle
{
"name": "Perimeter of Triangle",
"description": r'''
Total distance around a triangle
$$P = a + b + c$$
Where:
- $P$: Perimeter (meters)
- $a, b, c$: Side lengths (meters)
The perimeter is the sum of all three sides.''',
"input": [
{"name": "a", "unit": "meter"}, // Side 1
{"name": "b", "unit": "meter"}, // Side 2
{"name": "c", "unit": "meter"} // Side 3
],
"output": {"name": "P", "unit": "meter"}, // Perimeter
"d4rtCode": "P = a + b + c;",
"tags": ["geometry", "triangle", "perimeter"]
},
// Area of Regular Polygon
{
"name": "Area of Regular Polygon",
"description": r'''
Area of a regular polygon with n sides
$$A = \frac{1}{4}ns^2\cot(\frac{\pi}{n})$$
Where:
- $A$: Area (square meters)
- $n$: Number of sides
- $s$: Side length (meters)
- $\pi$: Pi ($\approx 3.14159$)
This formula works for any regular polygon (equal sides and angles).''',
"input": [
{"name": "n", "unit": "scalar"}, // Number of sides
{"name": "s", "unit": "meter"} // Side length
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": "A = 0.25 * n * pow(s, 2) * (cos(pi/n) / sin(pi/n));",
"tags": ["geometry", "polygon", "area"]
},
// Sum of Interior Angles of Polygon
{
"name": "Sum of Interior Angles",
"description": r'''
Sum of interior angles of a polygon
$$S = (n - 2) \times 180°$$
Where:
- $S$: Sum of interior angles (degrees)
- $n$: Number of sides
This formula works for any simple polygon.''',
"input": [
{"name": "n", "unit": "scalar"} // Number of sides
],
"output": {"name": "S", "unit": "degree"}, // Sum of angles
"d4rtCode": "S = (n - 2) * 180;",
"tags": ["geometry", "polygon", "angles"]
},
// Heron's Formula (Area of Triangle)
{
"name": "Heron's Formula",
"description": r'''
Area of a triangle using only side lengths
$$A = \sqrt{s(s-a)(s-b)(s-c)}$$
Where:
- $A$: Area (square meters)
- $a, b, c$: Side lengths (meters)
- $s$: Semi-perimeter $= \frac{a+b+c}{2}$
2026-02-18 08:46:02 +00:00
This formula is useful when height is unknown.
**Note:** The side lengths must satisfy the triangle inequality: the sum of any two sides must be greater than the third side (a+b>c, a+c>b, b+c>a). If this condition is not met, the formula returns NaN.''',
2026-02-17 16:35:51 +00:00
"input": [
{"name": "a", "unit": "meter"}, // Side 1
{"name": "b", "unit": "meter"}, // Side 2
{"name": "c", "unit": "meter"} // Side 3
],
"output": {"name": "A", "unit": "square meter"}, // Area
"d4rtCode": """
2026-02-18 08:46:02 +00:00
if( a + b < c || a+c < b || b+c < a ){
signal( "There is not a valid triangle with those longitudes" );
}
2026-02-17 16:35:51 +00:00
var s = (a + b + c) / 2;
A = sqrt(s * (s - a) * (s - b) * (s - c));
""",
"tags": ["geometry", "triangle", "area"]
2026-02-07 11:52:55 +00:00
}
2025-09-20 14:46:21 +00:00
]