Pre-built functions for common scientific and engineering calculations with unit-aware dimensional consistency
Stdlib modules are embedded in the binary at compile time and can be imported using the standard import syntax. Stdlib modules have priority over user modules with the same name, ensuring consistent behavior across all ExprUA programs.
# Import a module
import geometry
area = area_circle(5 m) # Returns 78.53981633974483 m^2
# Import multiple modules
import geometry
import mechanics
import kinematics
# Use functions from imported modules
radius = 10 m
volume = volume_sphere(radius)
force = force(5 kg, 9.81 m/s²)
Calculate areas, volumes, and perimeters for common 2D and 3D shapes with unit-aware dimensional consistency.
area_circle(radius: m) -> m^2 - Area of a circlecircumference_circle(radius: m) -> m - Circumference of a circlearea_circle_sector(radius: m, angle_radians: dimensionless) -> m^2 - Area of a circle sectorarc_length_circle_sector(radius: m, angle_radians: dimensionless) -> m - Arc length of a circle sectorarea_circle_segment(radius: m, angle_radians: dimensionless) -> m^2 - Area of a circle segmentarea_annulus(outer_radius: m, inner_radius: m) -> m^2 - Area of an annulus (ring)perimeter_annulus(outer_radius: m, inner_radius: m) -> m - Perimeter of an annulusvolume_sphere(radius: m) -> m^3 - Volume of a spheresurface_area_sphere(radius: m) -> m^2 - Surface area of a spherevolume_cylinder(radius: m, height: m) -> m^3 - Volume of a cylindersurface_area_cylinder(radius: m, height: m) -> m^2 - Total surface area of a cylinderlateral_surface_area_cylinder(radius: m, height: m) -> m^2 - Lateral surface area of a cylindervolume_cone(radius: m, height: m) -> m^3 - Volume of a conesurface_area_cone(radius: m, height: m) -> m^2 - Total surface area of a conelateral_surface_area_cone(radius: m, height: m) -> m^2 - Lateral surface area of a conearea_rectangle(length: m, width: m) -> m^2 - Area of a rectangleperimeter_rectangle(length: m, width: m) -> m - Perimeter of a rectanglearea_square(side: m) -> m^2 - Area of a squareperimeter_square(side: m) -> m - Perimeter of a squarevolume_rectangular_prism(length: m, width: m, height: m) -> m^3 - Volume of a rectangular prismsurface_area_rectangular_prism(length: m, width: m, height: m) -> m^2 - Surface area of a rectangular prismvolume_cube(side: m) -> m^3 - Volume of a cubesurface_area_cube(side: m) -> m^2 - Surface area of a cubearea_triangle(base: m, height: m) -> m^2 - Area using base and heightarea_triangle_heron(a: m, b: m, c: m) -> m^2 - Area using Heron's formulaarea_trapezoid(base1: m, base2: m, height: m) -> m^2 - Area of a trapezoidarea_parallelogram(base: m, height: m) -> m^2 - Area of a parallelogramarea_ellipse(semi_major_axis: m, semi_minor_axis: m) -> m^2 - Area of an ellipseperimeter_ellipse(semi_major_axis: m, semi_minor_axis: m) -> m - Perimeter of an ellipsearea_rhombus(diagonal1: m, diagonal2: m) -> m^2 - Area of a rhombusarea_rhombus_side_height(side: m, height: m) -> m^2 - Area of a rhombus using side and heightperimeter_rhombus(side: m) -> m - Perimeter of a rhombusarea_kite(diagonal1: m, diagonal2: m) -> m^2 - Area of a kitearea_regular_polygon(side_length: m, num_sides: dimensionless) -> m^2 - Area of a regular polygonperimeter_regular_polygon(side_length: m, num_sides: dimensionless) -> m - Perimeter of a regular polygonarea_regular_hexagon(side: m) -> m^2 - Area of a regular hexagonperimeter_regular_hexagon(side: m) -> m - Perimeter of a regular hexagonarea_regular_pentagon(side: m) -> m^2 - Area of a regular pentagonperimeter_regular_pentagon(side: m) -> m - Perimeter of a regular pentagonvolume_pyramid_square_base(base_side: m, height: m) -> m^3 - Volume of a square-based pyramidvolume_pyramid_rectangular_base(length: m, width: m, height: m) -> m^3 - Volume of a rectangular-based pyramidsurface_area_pyramid_square_base(base_side: m, height: m) -> m^2 - Surface area of a square-based pyramidvolume_torus(major_radius: m, minor_radius: m) -> m^3 - Volume of a torussurface_area_torus(major_radius: m, minor_radius: m) -> m^2 - Surface area of a torusvolume_ellipsoid(semi_axis_a: m, semi_axis_b: m, semi_axis_c: m) -> m^3 - Volume of an ellipsoidvolume_regular_tetrahedron(edge_length: m) -> m^3 - Volume of a regular tetrahedronsurface_area_regular_tetrahedron(edge_length: m) -> m^2 - Surface area of a regular tetrahedronvolume_regular_octahedron(edge_length: m) -> m^3 - Volume of a regular octahedronsurface_area_regular_octahedron(edge_length: m) -> m^2 - Surface area of a regular octahedronvolume_regular_icosahedron(edge_length: m) -> m^3 - Volume of a regular icosahedronsurface_area_regular_icosahedron(edge_length: m) -> m^2 - Surface area of a regular icosahedronvolume_regular_dodecahedron(edge_length: m) -> m^3 - Volume of a regular dodecahedronsurface_area_regular_dodecahedron(edge_length: m) -> m^2 - Surface area of a regular dodecahedrondistance_2d(x1: m, y1: m, x2: m, y2: m) -> m - Distance between two points in 2Ddistance_3d(x1: m, y1: m, z1: m, x2: m, y2: m, z2: m) -> m - Distance between two points in 3Dmidpoint_2d(x1: m, y1: m, x2: m, y2: m) -> m - X-coordinate of midpoint in 2Dmidpoint_3d(x1: m, y1: m, z1: m, x2: m, y2: m, z2: m) -> m - X-coordinate of midpoint in 3DCalculate forces, work, energy, power, momentum, torque, and pressure with dimensional consistency.
force(mass: kg, acceleration: m/s^2) -> N - Newton's second lawforce_weight(mass: kg) -> N - Weight force (uses standard gravity constant g)force_friction_kinetic(normal_force: N, coefficient_kinetic: dimensionless) -> N - Kinetic friction forceforce_friction_static_max(normal_force: N, coefficient_static: dimensionless) -> N - Maximum static friction forceforce_centripetal(mass: kg, velocity: m/s, radius: m) -> N - Centripetal forceforce_centripetal_angular(mass: kg, angular_velocity: Hz, radius: m) -> N - Centripetal force from angular velocityforce_gravitational(mass1: kg, mass2: kg, distance: m) -> N - Gravitational force (uses gravitational constant G)work_force_distance(force: N, distance: m) -> J - Work done by constant forcework_force_distance_angle(force: N, distance: m, angle_radians: dimensionless) -> J - Work with angle componentenergy_kinetic(mass: kg, velocity: m/s) -> J - Kinetic energyenergy_potential_gravitational(mass: kg, height: m) -> J - Gravitational potential energy (uses standard gravity constant g)energy_potential_spring(spring_constant: N/m, displacement: m) -> J - Spring potential energyenergy_mechanical(kinetic_energy: J, potential_energy: J) -> J - Total mechanical energypower_work_time(work: J, time: s) -> W - Power from work and timepower_force_velocity(force: N, velocity: m/s) -> W - Power from force and velocitypower_force_velocity_angle(force: N, velocity: m/s, angle_radians: dimensionless) -> W - Power with angle componentmomentum(mass: kg, velocity: m/s) -> kg*m/s - Linear momentummomentum_change(initial_momentum: kg*m/s, final_momentum: kg*m/s) -> kg*m/s - Change in momentumimpulse(force: N, time: s) -> kg*m/s - Impulseimpulse_momentum_theorem(initial_momentum: kg*m/s, final_momentum: kg*m/s) -> kg*m/s - Impulse-momentum theoremtorque_force_radius(force: N, radius: m) -> N*m - Torque from force and radiustorque_force_radius_angle(force: N, radius: m, angle_radians: dimensionless) -> N*m - Torque with angle componenttorque_angular_acceleration(moment_of_inertia: kg*m^2, angular_acceleration: Hz/s) -> N*m - Torque from angular accelerationpressure_force_area(force: N, area: m^2) -> Pa - Pressure from force and areapressure_depth(density: kg/m^3, depth: m) -> Pa - Hydrostatic pressure (uses standard gravity constant g)spring_force(spring_constant: N/m, displacement: m) -> N - Spring force (Hooke's law)spring_constant(force: N, displacement: m) -> N/m - Spring constant from force and displacementmomentum_conservation_1d(mass1: kg, velocity1_initial: m/s, mass2: kg, velocity2_initial: m/s, velocity1_final: m/s) -> m/s - Final velocity of mass2 in 1D collisionkinetic_energy_elastic_collision(mass1: kg, velocity1_initial: m/s, mass2: kg, velocity2_initial: m/s) -> J - Total kinetic energy in elastic collisionefficiency_useful_output(useful_output: J, total_input: J) -> dimensionless - Efficiency from energyefficiency_power(useful_power: W, total_power: W) -> dimensionless - Efficiency from powerCalculate motion equations, velocity, acceleration, displacement, projectile motion, and circular motion.
velocity_displacement_time(displacement: m, time: s) -> m/s - Average velocityvelocity_initial_acceleration_time(initial_velocity: m/s, acceleration: m/s^2, time: s) -> m/s - Final velocity from accelerationvelocity_initial_acceleration_displacement(initial_velocity: m/s, acceleration: m/s^2, displacement: m) -> m/s - Final velocity from displacementacceleration_velocity_time(initial_velocity: m/s, final_velocity: m/s, time: s) -> m/s^2 - Average accelerationacceleration_force_mass(force: N, mass: kg) -> m/s^2 - Acceleration from forcedisplacement_velocity_time(initial_velocity: m/s, final_velocity: m/s, time: s) -> m - Displacement from average velocitydisplacement_initial_acceleration_time(initial_velocity: m/s, acceleration: m/s^2, time: s) -> m - Displacement with constant accelerationdisplacement_velocity_acceleration(initial_velocity: m/s, final_velocity: m/s, acceleration: m/s^2) -> m - Displacement from velocity and accelerationfree_fall_velocity(initial_velocity: m/s, time: s) -> m/s - Velocity in free fall (uses standard gravity constant g)free_fall_displacement(initial_velocity: m/s, time: s) -> m - Displacement in free fall (uses standard gravity constant g)free_fall_time_max_height(initial_velocity: m/s) -> s - Time to reach maximum height (uses standard gravity constant g)free_fall_max_height(initial_velocity: m/s) -> m - Maximum height in free fall (uses standard gravity constant g)projectile_range(initial_velocity: m/s, angle_radians: dimensionless) -> m - Horizontal range (uses standard gravity constant g)projectile_max_height(initial_velocity: m/s, angle_radians: dimensionless) -> m - Maximum height (uses standard gravity constant g)projectile_time_of_flight(initial_velocity: m/s, angle_radians: dimensionless) -> s - Time of flight (uses standard gravity constant g)projectile_velocity_x(initial_velocity: m/s, angle_radians: dimensionless) -> m/s - Horizontal velocity componentprojectile_velocity_y(initial_velocity: m/s, angle_radians: dimensionless, time: s) -> m/s - Vertical velocity component (uses standard gravity constant g)projectile_position_x(initial_velocity: m/s, angle_radians: dimensionless, time: s) -> m - Horizontal positionprojectile_position_y(initial_velocity: m/s, angle_radians: dimensionless, time: s) -> m - Vertical position (uses standard gravity constant g)angular_velocity_linear(linear_velocity: m/s, radius: m) -> Hz - Angular velocity from linear velocityangular_velocity_period(period: s) -> Hz - Angular velocity from periodangular_velocity_frequency(frequency: Hz) -> Hz - Angular velocity from frequencylinear_velocity_angular(angular_velocity: Hz, radius: m) -> m/s - Linear velocity from angular velocityangular_acceleration(initial_angular_velocity: Hz, final_angular_velocity: Hz, time: s) -> 1/s² - Angular accelerationcentripetal_acceleration(velocity: m/s, radius: m) -> m/s^2 - Centripetal accelerationcentripetal_acceleration_angular(angular_velocity: Hz, radius: m) -> m/s^2 - Centripetal acceleration from angular velocityperiod_frequency(frequency: Hz) -> s - Period from frequencyfrequency_period(period: s) -> Hz - Frequency from periodrelative_velocity(velocity1: m/s, velocity2: m/s) -> m/s - Relative velocityvelocity_addition_1d(velocity1: m/s, velocity2: m/s) -> m/s - Velocity addition in 1D