Witam, moje pytanie brzmi, czemu ten sam kod daje w rezultacie różne wyniki ?
obraz w załączniku
fragment kodu tego po lewej :
if (WGS84.isSelected() )
{
//X = (N + h) * cosB * cosL
//Y = (N + h) * cosB * sinL
//Z = (N * (1 - e^2)) * sinB
//N = a / (sqrt(1 - e^2 * sin^2 * B))
B =(Double.valueOf(tB.getText()));
L =(Double.valueOf(tL.getText()));
h =(Double.valueOf(th.getText()));
N1=a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega)));
N2=a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega)));
X1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*cos((L*PI)/180);
Y1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*sin((L*PI)/180);
Z1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))*(1-e1))*sin((B*PI)/180);
X2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*cos((L*PI)/180);
Y2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*sin((L*PI)/180);
Z2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))*(1-e2))*sin((B*PI)/180);
java.text.DecimalFormat df=new java.text.DecimalFormat("0.0000");
twynikN2.setText(String.valueOf(df.format(N2)));
twynikX2.setText(String.valueOf(df.format(X2)));
twynikY2.setText(String.valueOf(df.format(Y2)));
twynikZ2.setText(String.valueOf(df.format(Z2)));
twynikX1.setText("");
twynikY1.setText("");
twynikZ1.setText("");
twynikN1.setText("");
fragment kodu tego prawej :
if (WGS84.isSelected() )
{
//X = (N + h) * cosB * cosL
//Y = (N + h) * cosB * sinL
//Z = (N * (1 - e^2)) * sinB
//N = a / (sqrt(1 - e^2 * sin^2 * B))
B = (Double.valueOf(tBst.getText()) + ((Double.valueOf(tBmin.getText()))/60) + ((Double.valueOf(tBsek.getText()))/3600));
L = (Double.valueOf(tLst.getText()) + ((Double.valueOf(tLmin.getText()))/60) + ((Double.valueOf(tLsek.getText())))/3600);
h =(Double.valueOf(th.getText()));
N1=a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega)));
N2=a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega)));
X1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*cos((L*PI)/180);
Y1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*sin((L*PI)/180);
Z1=((a1/(sqrt(1-e1*pow(sin((B*PI)/180),potega))))*(1-e1))*sin((B*PI)/180);
X2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*cos((L*PI)/180);
Y2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))+h)*cos((B*PI)/180)*sin((L*PI)/180);
Z2=((a2/(sqrt(1-e2*pow(sin((B*PI)/180),potega))))*(1-e2))*sin((B*PI)/180);
java.text.DecimalFormat df=new java.text.DecimalFormat("0.0000");
twynikN2.setText(String.valueOf(df.format(N2)));
twynikX2.setText(String.valueOf(df.format(X2)));
twynikY2.setText(String.valueOf(df.format(Y2)));
twynikZ2.setText(String.valueOf(df.format(Z2)));
twynikX1.setText("");
twynikY1.setText("");
twynikZ1.setText("");
twynikN1.setText("");
wspomnę, że jestem początkujący ;p