📘 Physics Dynamics Calculator in C
This project is a command-line tool in C that allows users to calculate various physics equations related to motion in a straight line, including: ✅ Supported Calculations
-
Instantaneous Velocity
v=dxdtv=dtdx
-
Instantaneous Acceleration
a=dvdta=dtdv
-
Average Speed
v=dxdtv=dtdx
-
Constant Acceleration Formula #1
v1=v0+a⋅tv1=v0+a⋅t
-
Constant Acceleration Formula #2
x1=x0+v0⋅t+12at2x1=x0+v0⋅t+21at2
-
Constant Acceleration Formula #3
x1=x0+(v0+v12)⋅tx1=x0+(2v0+v1)⋅t
-
Constant Acceleration Formula #4
v12=v02+2a(x1−x0)v12=v02+2a(x1−x0)
-
Newton's Second Law
ΣF=m⋅aΣF=m⋅a
🧪 How to Use
Run the program:
gcc physic.c -L. -lphysics -lm -o physic
./physic
Choose the equation you want to use by number.
Select the unknown variable.
Enter the known values as prompted.
The program will compute and print the result.
🧱 Structure
The program is modular and separated into header and source files for:
Instantaneous velocity
Instantaneous acceleration
Average speed
Constant acceleration laws (CALaw4, CALaw5, CALaw6, CALaw7)
Newton’s second law
⚙️ Dependencies
Make sure to link against the math library during compilation:
-lm