_scienceMathsChuteLibre
Retrieve some parameters from equations hourly of an object in free fall under
only the force of a gravity field.
Equation hourly of the speed from to time :
V(t) = -gt + V0
Equation hourly of the altitude relative to time :
Z(t) = -1/2gtē + V0t + Z0
With g is the standard gravity, V0 is the initial speed and
Z0 is the initial height.
The trajectory is a right line possibly in two-way (downwards only or upwards
then downwards), in the same plane. The rules are as follows :
- a vertical movement, the unit vector pointing upwards;
- the time is in seconds;
- the height (altitude) is in meters;
- the speed is in meters by second (m.s-1).
The result depends on the value of the flag.
Prototype :
fun [F F F I F] F
- F : g : the standard gravity. Can be nil, in this case, the
default value will be 9.8 m.s-2 (its an average value on Earth).
- F : V0 : the initial speed. If positive, the object goes to up in
the first time, if negative, the object goes to bottom. Can be nil, then this
value will be 0.0.
- F : H0 : the initial height (altitude). Can be nil, then this
value will be 0.0.
- I : a flag :
- SCOLMATHS_MVT_GETSPEED_TOTIME : get the speed from to the time
- SCOLMATHS_MVT_GETTIME_TOSPEED : get the elapsed time from to the speed
- SCOLMATHS_MVT_GETHEIGHT_TOTIME : get the height from to the time
- SCOLMATHS_MVT_GETHEIGHT_TOSPEED : get the height from to the speed
- SCOLMATHS_MVT_GETSPEED_TOHEIGHT : get the speed from to the height
- SCOLMATHS_MVT_GETTIME_TOHEIGHT : get the elapsed time from to the height
- F : a parameter. It depends on the flag. Can be nil, then this value will
be 0.0.
By example, if the flag is SCOLMATHS_MVT_GETSPEED_TOTIME then this
parameter is the time (2.0 for t=2 seconds).
Return : F the result or nil if error
See also :
Example :
Get the height after 1 second. The initial speed is 2 m/s and the initial height
is 5.5 meters. The result is 2.6 meters.
fun main ()=
_showconsole;
_fooF _scienceMathsChuteLibre nil 2.0 5.5 SCOLMATHS_MVT_GETHEIGHT_TOTIME 1.0; // 2.600000
0;;
Note
Results are approximations (depends on float definition)