PROGRAM gravity
  IMPLICIT NONE
  DOUBLE PRECISION, PARAMETER :: G = 6.674d-11

  DOUBLE PRECISION :: m1, x1, y1,z1
  DOUBLE PRECISION :: m2, x2, y2,z2
  DOUBLE PRECISION :: r, f

  PRINT *, "Dose m1,x1,y1,z1"
  READ *, m1,x1,y1,z1

  PRINT *, "Dose m2,x2,y2,z2"
  READ *, m2,x2,y2,z2

  r = SQRT((x2-x1)**2+(y2-y1)**2+(z2-z1)**2)

  PRINT *, "H apostash einai", r

  f = G * m1*m2/r**2

  IF (f <= 1d-10) f = 0d0

  PRINT *, "H dynami einai ", f
  
END PROGRAM gravity
