Current location - Training Enrollment Network - Mathematics courses - Analysis of java mathematical formula
Analysis of java mathematical formula
//trangle? There are three coordinates in the function. Where a is a right angle

Public? Static electricity Invalid? Trangle (double? A_x, double? A_y, double? B_x, double? B_y, double? C_x, double? c_y){

//Math.sqrt(x) stands for root symbol. Math.pow(x, n) represents the n power of x.

Double? ab? =? Math.sqrt(Math.pow(a_x-b_x,? 2)? +? Math.pow(a_y? -? b_y,? 2)); //straight line ab

Double? ac? =? Math.sqrt(Math.pow(a_x-c_x,? 2)? +? Math.pow(a_y? -? c_y,? 2)); //straight line bc

//Find angles b and c degrees. mathmatics PI stands for π; Math.atan2(x, y) stands for arc tante (x/y), which is arc length in Java, so the length should be converted into degrees.

Double? b? =? Math.atan2(ac,? Ab)* 180/ Mathematics. PI;

Double? c? =? Math.atan2(ab,? AC)* 180/ math. PI;

system . out . println(" B:"+B+" \ nC:"+C+" ");

}