Program to determine focal length of a spherical mirror | Determines focal length of a spherical concave mirror ; Determines focal length of a spherical convex mirror ; Driver function
< ? php function focal_length_concave ( $ R ) { return $ R / 2 ; } function focal_length_convex ( $ R ) { return - ( $ R / 2 ) ; } $ R = 30 ; echo " Focal ▁ length ▁ of ▁ spherical " , " concave ▁ mirror ▁ is ▁ : ▁ " , focal_length_concave ( $ R ) , " ▁ units STRNEWLINE " ; echo " Focal ▁ length ▁ of ▁ spherical " , " ▁ convex ▁ mirror ▁ is ▁ : ▁ " , focal_length_convex ( $ R ) , " ▁ units " ; ? >