A set of some of the most common physics formulas and constants.
- It provides Physics formulas and constants for calculation porpuses.
- It allows to create some objects to simplify some calculations (see example).
- It also provides some common Math formulas in Physics.
- Force, Speed, Time, Work, Acceleration, Density, Intensity, Power, Momentum
- Potential Energy, Mechanical Energy, Kinetic Energy, Frequency, Doppler Effect
- Centripetal Acceleration, Centripetal Force, Pendulum Period, Projectile motion equations
- Potential Gravitational Energy, Universal Gravitational Law, Gravitational Field
- Escape Speed
- Stokes's Law, Hagen-Poiseuille's Law
- Ohm's Law, Capacitance, Voltage, Coulomb's Law, Energy Density
- Electric Field, Eletric Potential Energy Difference.
- Gay-Lussac's Law, Net Heat Energy, Heat Flux, Eletric Field Flux, Joule Heating
- Lorentz Factor, Relativistic Time, Relativistic Distance, Relativstic Mass, Relativistic Momentum
- Photoelettric Effect, Drift Speed.
- Download the 'formulas' package to get the Physics formulas:
go get -u github.com/Gabri432/gophysics/formulas
- Download the 'constants' package to get the Physics constants:
go get -u github.com/Gabri432/gophysics/constants
- Download the 'mathem' package to get the Mathematical functions and constants of the library
go get -u github.com/Gabri432/gophysics/mathem
- Example of usage
package main
import (
"fmt"
"github.com/Gabri432/gophysics/constants"
"github.com/Gabri432/gophysics/formulas"
)
func main() {
fmt.Println(constants.C) // Write a constant
fmt.Println(formulas.Force(3, 4)) // Call a function
myPlanet := formulas.PlanetBody{Mass: constants.EARTH_MASS, Radius: constants.EARTH_RADIUS} // Create a custom object
fmt.Println(myPlanet.EscapeSpeed()) // Call object methods to ease some calculations
}
=== Output ===
299792453
12 N <<< When calling functions their output is the value and the measurement unit
11183.719071923773 m/s- Using mathematical functions
import (
"fmt"
"github.com/Gabri432/gophysics/mathem"
)
func main() {
fmt.Println(mathem.Pi) // Writing a constant
}
=== Output ===
3.1415926535gophysics.go, doesn't provide formulas, but other functions to simplify some actions.license,readme.md,readme.it.md,CHANGELOG.txt.
classical.go, where all the Classical physics formulas are located.fluids.go, where all the Fluid formulas are located.gravity.go, where all the Gravity formulas are located.thermodynamics.go, where all the Thermodynamics formulas are located.electromagnetism.go, where all the Electromagnetism formulas are located.relativity.go, where all the Relativity formulas are located.
constants.go, where all the constants are located.
constants.go, where all the mathematical constants are located.conversions.go, where all the main functions to make mathematical calculations are located.
- If you want to add a feature or making a fix check out this page explaining how to do it: Contributing to gophysics
- Formulas were taken from this italian book: Title - "Fisica Volume 1", Authors - ["Paolo Mazzoldi", "Massimo Nigro", "Cesare Voci"].