Professional Documents
Culture Documents
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pryconversiones;
/**
*
* @author Javier
*/
public class frmMenu extends javax.swing.JFrame {
/**
* Creates new form frmMenu
*/
public frmMenu() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Menu Opciones"));
jButton3.setText("Cerrar Programa");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/pryconversiones/folder/coo_geograficas.jpg"))); //
NOI18N
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 90, -1, -1));
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(frmMenu.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(frmMenu.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(frmMenu.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(frmMenu.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pryconversiones;
import java.text.NumberFormat;
/**
*
* @author Javier
*/
public class frmConversion extends javax.swing.JFrame {
String[] elipsoides={
"Airy 1830-6377563.396-6356256.91",
"Airy Modificad 1965-6377340.189-6356034.4479",
"Bessel 1841-6377397.155000-6356078.962840",
"Clarke 1866-6378206.400000-6356583.800000",
"Clarke 1880-6378249.145000-6356514.869550",
"Fischer 1960-6378166.000000-6356784.280000",
"Fischer 1968-6378150.000000-6356768.330000",
"GRS 1980-6378137.000000-6356752.314140",
"Hayford 1909-6378388.000000-6356911.946130",
"Helmert 1906-6378200.000000-6356818.170000",
"Hough 1960-6378270.000000-6356794.343479",
"Internacional 1909-6378388.000000-6356911.946130",
"Internacional 1924-6378388.000000-6356911.946130",
"Krasovsky 1940-6378245.000000-6356863.018800",
"Mercury 1960-6378166.000000-6356784.283666",
"Mercury Modificado 1968-6378150.000000-6356768.337303",
"Nuevo International 1967-6378157.500000-6356772.200000",
"Sudamericano 1969-6378160.000000-6356774.720000",
"Walbeck 1817-6376896.000000-6355834.846700",
"WGS66-6378145.000000-6356759.769356",
"WGS72-6378135.000000-6356750.519915",
"WGS84-6378137.000000-6356752.314245"};
/**
* Creates new form frmConversion
*/
double sexaDecimalLongEW=0.0;
double sexaDecimalLatNS=0.0;
double radianesLon=0.0;
double radianesLat=0.0;
double huso;
double meridhuso;
double lambda;
double A;
double Xi;
double Eta;
double exentricidad,exentricidad1,exentricidad2,radioCurvatura ;
double Ni;
double A1;
double A2;
double J2;
double J4;
double J6;
double Alfa;
double Beta;
double Gamma;
double B_fi;
double X;
double Y;
double Zeta=0.0;
public frmConversion() {
initComponents();
LlenarElipsoides();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
lonGra = new javax.swing.JTextField();
latGra = new javax.swing.JTextField();
lonMin = new javax.swing.JTextField();
latMin = new javax.swing.JTextField();
cboLatLonEW = new javax.swing.JComboBox<>();
cboLatLonNS = new javax.swing.JComboBox<>();
lonSeg = new javax.swing.JTextField();
latSeg = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
UtmEsteX = new javax.swing.JTextField();
UtmNorteY = new javax.swing.JTextField();
Huso = new javax.swing.JTextField();
btnConvertir = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
cboElipsoide = new javax.swing.JComboBox<>();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
lblExcentricidad = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
lbl_c_radioPolar = new javax.swing.JLabel();
lblA = new javax.swing.JLabel();
lblB = new javax.swing.JLabel();
lbl2daExce = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
lblExccuadrado = new javax.swing.JLabel();
jLabel24 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setText("Coordenadas");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 180, -1, -1));
jLabel2.setText("Longitud: ");
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 200, -1, -1));
jLabel3.setText("Latitud: ");
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 220, -1, -1));
jLabel4.setText("GRADOS");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 180, -1, -
1));
jLabel5.setText("MINUTOS");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 180, -1, -
1));
jLabel6.setText("SEGUNDOS");
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 180, -1, -
1));
lonGra.setText("0");
getContentPane().add(lonGra, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 200, 60, -
1));
latGra.setText("0");
getContentPane().add(latGra, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 220, 60, -1));
lonMin.setText("0");
getContentPane().add(lonMin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 200, 60, -
1));
latMin.setText("0");
getContentPane().add(latMin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 220, 60, -
1));
lonSeg.setText("0");
getContentPane().add(lonSeg, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 200, 70, -
1));
latSeg.setText("0");
getContentPane().add(latSeg, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 220, 70, -1));
jLabel8.setText("Longitud/Latitud");
getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 180, -1, -
1));
jLabel9.setText("COORDENADAS CONVERTIDAS");
getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 270, -1, -
1));
jLabel12.setText("Huso");
getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 330, -1, -
1));
getContentPane().add(UtmEsteX, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 290,
140, -1));
getContentPane().add(UtmNorteY, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 310,
140, -1));
getContentPane().add(Huso, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 330, 140, -
1));
btnConvertir.setText("Convertir");
btnConvertir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnConvertirActionPerformed(evt);
}
});
getContentPane().add(btnConvertir, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 250,
80, -1));
cboElipsoide.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboElipsoideItemStateChanged(evt);
}
});
cboElipsoide.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
cboElipsoideMouseClicked(evt);
}
});
getContentPane().add(cboElipsoide, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 50,
270, -1));
jLabel15.setText("Excentrcidad: ");
getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 120, -1, -
1));
lblExcentricidad.setText("...");
getContentPane().add(lblExcentricidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(150,
120, 170, -1));
lbl_c_radioPolar.setText("...");
getContentPane().add(lbl_c_radioPolar, new org.netbeans.lib.awtextra.AbsoluteConstraints(390,
120, 170, -1));
lblA.setText("...");
getContentPane().add(lblA, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 80, 170, -1));
lblB.setText("...");
getContentPane().add(lblB, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 100, 170, -1));
lbl2daExce.setText("...");
getContentPane().add(lbl2daExce, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 80, 150,
-1));
jLabel22.setText("e'(cuadrado): ");
getContentPane().add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 100, -1, -
1));
lblExccuadrado.setText("...");
getContentPane().add(lblExccuadrado, new org.netbeans.lib.awtextra.AbsoluteConstraints(390,
100, 160, -1));
pack();
}// </editor-fold>
public void LlenarElipsoides(){
for(int i=0;i<elipsoides.length;i++)
{ String[] partes=elipsoides[i].split("-");
cboElipsoide.addItem(partes[0].toString());
}
}
private void btnConvertirActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(cboLatLonEW.getSelectedItem().toString().equals("W")){
double p1=(Double.parseDouble(lonSeg.getText().toString())/60)/60;
double p2=Double.parseDouble(lonMin.getText().toString())/60;
double p3=Double.parseDouble(lonGra.getText().toString());
sexaDecimalLongEW= -1*(p1+p2+p3);
}
else
{
double p1=(Double.parseDouble(lonSeg.getText().toString())/60)/60;
double p2=Double.parseDouble(lonMin.getText().toString())/60;
double p3=Double.parseDouble(lonGra.getText().toString());
sexaDecimalLongEW=p1+p2+p3;
}
if(cboLatLonNS.getSelectedItem().toString().equals("S")){
double p1=(Double.parseDouble(latSeg.getText().toString())/60)/60;
double p2=Double.parseDouble(latMin.getText().toString())/60;
double p3=Double.parseDouble(latGra.getText().toString());
sexaDecimalLatNS= -1*(p1+p2+p3);
}
else{
double p1=(Double.parseDouble(latSeg.getText().toString())/60)/60;
double p2=Double.parseDouble(latMin.getText().toString())/60;
double p3=Double.parseDouble(latGra.getText().toString());
sexaDecimalLatNS=p1+p2+p3;
}
radianesLon=(sexaDecimalLongEW*Math.PI)/180;
radianesLat=(sexaDecimalLatNS*Math.PI)/180;
double dou=(sexaDecimalLongEW/6)+31;
String vdStr=Double.toString(dou);
String pe="";
for(int i=0;i<vdStr.length();i++)
{
if(vdStr.charAt(i)=='.')
break;
pe+=vdStr.charAt(i);
}
huso=Double.parseDouble(pe);
meridhuso = 6*huso-183;
lambda = +(radianesLon)-((meridhuso*Math.PI)/180);
A = Math.cos(radianesLat)*Math.sin(lambda);
Xi=(0.5)*Math.log((1+A)/(1-A));
double p1=Math.pow(Math.cos(radianesLat),2);
double p2=1+Double.parseDouble(lblExccuadrado.getText())*p1;
double p3=Math.pow(p2, ((double)1/2));
double p4=Double.parseDouble(lbl_c_radioPolar.getText());
Ni= (p4/p3)*0.9996;
double p11=Math.cos(radianesLat)*Math.cos(radianesLat);
double p22=Xi*Xi;
double p33=Double.parseDouble(lblExccuadrado.getText())/2;
Zeta=p11*p22*p33;
A1 = Math.sin(2*radianesLat);
A2= A1*(Math.cos(radianesLat)*Math.cos(radianesLat));
J2=radianesLat+(A1/2);
J4=((3*J2)+A2)/4;
J6=(5*J4+A2*(Math.cos(radianesLat)*Math.cos(radianesLat)))/3;
Alfa=((double)3/4)*Double.parseDouble(lblExccuadrado.getText());
Beta=((double)5/3)*(Alfa*Alfa);
Gamma=((double)35/27)*(Alfa*Alfa*Alfa);
B_fi=0.9996*Double.parseDouble(lbl_c_radioPolar.getText())*(radianesLat-(Alfa*J2)+(Beta*J4)-
(Gamma*J6));
System.out.println(sexaDecimalLongEW);
System.out.println(sexaDecimalLatNS);
System.out.println(radianesLon);
System.out.println(radianesLat);
System.out.println("Calculo uso="+huso);
System.out.println("A="+A);
System.out.println("Xi="+Xi);
System.out.println("Eta="+Eta);
System.out.println("Ni="+Ni);
System.out.println("Zeta: "+Zeta);
System.out.println("A1="+A1);
System.out.println("A2="+A2);
System.out.println("J2="+J2);
System.out.println("J4="+J4);
System.out.println("J6="+J6);
System.out.println("Alfa="+Alfa);
System.out.println("Beta="+Beta);
System.out.println("Gamma="+Gamma);
System.out.println("B_fi="+B_fi);
X=Xi*Ni*(1+Zeta/3)+500000;
if(cboLatLonNS.getSelectedItem().toString().equals("S")){
Y=Eta*Ni*(1+Zeta)+B_fi+10000000;
}
else{
Y=Eta*Ni*(1+Zeta)+B_fi;
}
UtmEsteX.setText(""+X);
UtmNorteY.setText(""+Y);
Huso.setText(""+huso);
}
}
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(frmConversion.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(frmConversion.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(frmConversion.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(frmConversion.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pryconversiones;
import java.sql.DriverManager;
/**
*
* @author Javier
*/
public class frmCoversion2 extends javax.swing.JFrame {
String[] elipsoides={
"Airy 1830-6377563.396-6356256.91",
"Airy Modificad 1965-6377340.189-6356034.4479",
"Bessel 1841-6377397.155000-6356078.962840",
"Clarke 1866-6378206.400000-6356583.800000",
"Clarke 1880-6378249.145000-6356514.869550",
"Fischer 1960-6378166.000000-6356784.280000",
"Fischer 1968-6378150.000000-6356768.330000",
"GRS 1980-6378137.000000-6356752.314140",
"Hayford 1909-6378388.000000-6356911.946130",
"Helmert 1906-6378200.000000-6356818.170000",
"Hough 1960-6378270.000000-6356794.343479",
"Internacional 1909-6378388.000000-6356911.946130",
"Internacional 1924-6378388.000000-6356911.946130",
"Krasovsky 1940-6378245.000000-6356863.018800",
"Mercury 1960-6378166.000000-6356784.283666",
"Mercury Modificado 1968-6378150.000000-6356768.337303",
"Nuevo International 1967-6378157.500000-6356772.200000",
"Sudamericano 1969-6378160.000000-6356774.720000",
"Walbeck 1817-6376896.000000-6355834.846700",
"WGS66-6378145.000000-6356759.769356",
"WGS72-6378135.000000-6356750.519915",
"WGS84-6378137.000000-6356752.314245"};
double meridianoCentral;
double YAlSerEcuador;
double Fi;
double exentricidad,exentricidad1,exentricidad2,radioCurvatura ;
double Ni;
double A1;
double A2;
double J2;
double J4;
double J6;
double Alfa;
double Beta;
double Gamma;
double B_fi;
double X;
double Y;
double a;
double b;
double Zeta;
double Xi;
double Eta;
double Senh;
double Delta;
double Tau;
double FnRad;
double SxDecimal1;
double SxDecimal2;
/**
* Creates new form frmCoversion2
*/
public frmCoversion2() {
initComponents();
LlenarCombox();
LlenarElipsoides();
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setText("DATOS DE ENTRADA");
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, -1));
jLabel4.setText("Huso: ");
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 220, -1, -1));
jLabel5.setText("Hemisferio: ");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 250, -1, -1));
getContentPane().add(txtUtmEsteX, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 170,
140, -1));
txtUtmNorteY.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtUtmNorteYActionPerformed(evt);
}
});
getContentPane().add(txtUtmNorteY, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 190,
139, -1));
txtMinutosLon.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtMinutosLonActionPerformed(evt);
}
});
getContentPane().add(txtMinutosLon, new org.netbeans.lib.awtextra.AbsoluteConstraints(240,
310, 119, -1));
getContentPane().add(txtSegundosLon, new org.netbeans.lib.awtextra.AbsoluteConstraints(360,
310, 150, -1));
getContentPane().add(txtGradosLat, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 340,
119, -1));
getContentPane().add(txtMinutosLat, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 340,
119, -1));
getContentPane().add(txtSegundosLat, new org.netbeans.lib.awtextra.AbsoluteConstraints(360,
340, 150, -1));
jLabel6.setText("Lambda (Longitud)");
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 310, -1, -1));
jLabel7.setText("Fi (Latitud)");
getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 340, -1, -1));
btnConvertir.setText("Convertir");
btnConvertir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnConvertirActionPerformed(evt);
}
});
getContentPane().add(btnConvertir, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 220, -
1, -1));
cboElipsoide.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboElipsoideItemStateChanged(evt);
}
});
cboElipsoide.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
cboElipsoideMouseClicked(evt);
}
});
getContentPane().add(cboElipsoide, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 10,
270, -1));
jLabel15.setText("Excentrcidad: ");
getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, -1, -1));
lblExcentricidad.setText("...");
getContentPane().add(lblExcentricidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 80,
170, -1));
lbl_c_radioPolar.setText("...");
getContentPane().add(lbl_c_radioPolar, new org.netbeans.lib.awtextra.AbsoluteConstraints(370,
80, 170, -1));
lblA.setText("...");
getContentPane().add(lblA, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 40, 170, -1));
lblB.setText("...");
getContentPane().add(lblB, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 60, 170, -1));
lbl2daExce.setText("...");
getContentPane().add(lbl2daExce, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 40, 150,
-1));
jLabel22.setText("e'(cuadrado): ");
getContentPane().add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 60, -1, -
1));
lblExccuadrado.setText("...");
getContentPane().add(lblExccuadrado, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 60,
160, -1));
pack();
}// </editor-fold>
private void txtUtmNorteYActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
double p1=Math.pow(Math.cos(Fi),2);
double p2=1+Double.parseDouble(lblExccuadrado.getText())*p1;
double p3=Math.pow(p2, ((double)1/2));
double p4=Double.parseDouble(lbl_c_radioPolar.getText());
Ni= (p4/p3)*0.9996;
a=(Double.parseDouble(txtUtmEsteX.getText())-500000)/Ni;
A1=Math.sin(2*Fi);
A2=A1*(Math.cos(Fi)*Math.cos(Fi));
J2=Fi+(A1/2);
J4=(3*J2+A2)/4;
J6=(5*J4+A2*(Math.cos(Fi)*Math.cos(Fi)))/3;
Alfa=((double) 3/4)*Double.parseDouble(lblExccuadrado.getText());
Beta=((double) 5/3)*Alfa*Alfa;
Gamma=((double) 35/27)*Alfa*Alfa*Alfa;
B_fi=0.9996*Double.parseDouble(lbl_c_radioPolar.getText())*(Fi-(Alfa*J2)+(Beta*J4)-(Gamma*J6));
b=(YAlSerEcuador-B_fi)/Ni;
Zeta=((Double.parseDouble(lblExccuadrado.getText())*a*a)/2)*(Math.cos(Fi)*Math.cos(Fi));
Xi=a*(1-(Zeta/3));
Eta=b*(1-Zeta)+Fi;
Senh=(Math.exp(Xi)-Math.exp(-Xi))/2;
Delta=Math.atan((Senh)/(Math.cos(Eta)));
Tau=Math.atan(Math.cos(Delta)*Math.tan(Eta));
double k3=Double.parseDouble(lblExccuadrado.getText());
double c2f=Math.cos(Fi)*Math.cos(Fi);
double sf=Math.sin(Fi);
double cf=Math.cos(Fi);
FnRad=Fi+((1+k3*c2f)-((double)3/2)*k3*sf*cf*(Tau-Fi))*(Tau-Fi);
SxDecimal1=+(Delta/Math.PI)*180+meridianoCentral;
SxDecimal2=+(FnRad/Math.PI)*180;
txtGradosLon.setText(truncar(SxDecimal1));
txtGradosLat.setText(truncar(SxDecimal2));
double mlong=(SxDecimal1-Double.parseDouble(txtGradosLon.getText()))*60;
double mlat=(SxDecimal2-Double.parseDouble(txtGradosLat.getText()))*60;
System.out.println("mlong:"+mlong);
System.out.println("mlat:"+mlat);
txtMinutosLon.setText(truncar(mlong));
txtMinutosLat.setText(truncar(mlat));
double slong=(((SxDecimal1-Double.parseDouble(txtGradosLon.getText()))*60)-
Double.parseDouble(txtMinutosLon.getText()))*60;
double slat=(((SxDecimal2-Double.parseDouble(txtGradosLat.getText()))*60)-
Double.parseDouble(txtMinutosLat.getText()))*60;
txtSegundosLon.setText(""+slong);
txtSegundosLat.setText(""+slat);
java.util.logging.Logger.getLogger(frmCoversion2.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(frmCoversion2.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(frmCoversion2.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(frmCoversion2.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>