Check whether two straight lines are parallel or not | Java program to implement the above approach ; Function to check if two lines are parallel or not ; If slopes are equal ; Driver Code ; Function Call
import java . util . * ; class GFG { static void parallel ( float a1 , float b1 , float c1 , float a2 , float b2 , float c2 ) { if ( ( - ( a1 / b1 ) ) == ( - ( a2 / b2 ) ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } public static void main ( String args [ ] ) { float a1 = - 2 , b1 = 4 , c1 = 5 ; float a2 = - 6 , b2 = 12 , c2 = 6 ; parallel ( a1 , b1 , c1 , a2 , b2 , c2 ) ; } }