Program to find Length of Latus Rectum of an Ellipse | Java program for the above approach ; Function to calculate the length of the latus rectum of an ellipse ; Length of major axis ; Length of minor axis ; Length of the latus rectum ; Driver code ; Given lengths of semi - major and semi - minor axis ; Function call to calculate length of the latus rectum of a ellipse
import java . util . * ; class GFG { static double lengthOfLatusRectum ( double A , double B ) { double major = 2.0 * A ; double minor = 2.0 * B ; double latus_rectum = ( minor * minor ) / major ; return latus_rectum ; } public static void main ( String [ ] args ) { double A = 3.0 , B = 2.0 ; System . out . print ( lengthOfLatusRectum ( A , B ) ) ; } }