Program to find the length of Latus Rectum of a Hyperbola | Java program for the above approach ; Function to calculate the length of the latus rectum of a hyperbola ; Store the length of major axis ; Store the length of minor axis ; Store the length of the latus rectum ; Return the length of the latus rectum ; Driver Code
import java . io . * ; 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 . println ( lengthOfLatusRectum ( A , B ) ) ; } }