Files
Gists/convertExposureTime.c/convertExposureTime.c
2023-06-21 21:40:58 -04:00

16 lines
531 B
C

/* A function to convert the exposure time between two f-stops.
* Usefull for pinhole cameras. See http://www.pinhole.cz/en/pinholecameras/exposure_01.html
*
* Parameters:
* *) f_from: The f-stop to convert from.
* *) f_to: The f-stop to convert to.
* *) exp_time: The exposure time for the aperture f_from.
*
* Return:
* The exposure time for aperture f_to.
*/
float convertExposureTime(int f_from, int f_to, float exp_time){
float aux = (float)f_to / (float)f_from;
return time * (aux * aux);
}