We want the speed to be in knots, or nautical miles per hour. But we have only the distance in meters, and the time in seconds, so it needs some conversion factors.
ship length in nautical miles= length/1852m
time in hours = time in seconds/3600s
Speed = length /time
Code:
Speed (in knots, nautical miles/hour) = length seconds
-------- / -------------
1852 3600
Speed (in knots, nautical miles/hour) = length 3600
------- * --------
1852 seconds
Speed (in knots, nautical miles/hour) = (3600/1852) * length/seconds
3600/1852 = 1.94...