Page 473 - 2
P. 473

double olat = OLAT * DEGRAD;

                   double sn = Math.tan(Math.PI * 0.25 + slat2 * 0.5) / Math.tan(Math.PI * 0.25 + slat1 * 0.5);
                   sn = Math.log(Math.cos(slat1) / Math.cos(slat2)) / Math.log(sn);
                   double sf = Math.tan(Math.PI * 0.25 + slat1 * 0.5);
                   sf = Math.pow(sf, sn) * Math.cos(slat1) / sn;
                   double ro = Math.tan(Math.PI * 0.25 + olat * 0.5);
                   ro = re * sf / Math.pow(ro, sn);
                   Map<String, Object> map = new HashMap<String, Object>();
                   map.put("lat", v1);
                   map.put("lng", v1);
                   double ra = Math.tan(Math.PI * 0.25 + (v1) * DEGRAD * 0.5);
                   ra = re * sf / Math.pow(ra, sn);
                   double theta = v2 * DEGRAD - olon;
                   if (theta > Math.PI)
                       theta -= 2.0 * Math.PI;
                   if (theta < -Math.PI)
                       theta += 2.0 * Math.PI;
                   theta *= sn;


                   map.put("x", (int)Math.floor(ra * Math.sin(theta) + XO + 0.5));
                   map.put("y", (int)Math.floor(ro - ra * Math.cos(theta) + YO + 0.5));


                   return map;
               }
            }


            2.  라즈베리 시스템 소스
            <Bluetooth_Connector>
            package com.example.dbstp.mdp_2;
            //import  생략
            public class Bluetooth_Connecter implements Runnable{


                    final UUID uuid = new UUID("0000110100001000800000805F9B34FB",false);
                    final String CONNECTION_URL_FOR_SPP = "btspp://localhost:" + uuid + ";name=SPP Server";
                    private StreamConnectionNotifier mStreamConnectionNotifier = null;
                    private StreamConnection mStreamConnection = null;
                    private int count = 0;


                    public Bluetooth_Connecter() {
                            LocalDevice localDevice = null;

                            HUD.Log("-- 현재 기기의 블루투스정보--");
                            try{
                                    localDevice = LocalDevice.getLocalDevice();
                            }catch(Exception exception){
                                    HUD.Log(" 블루투스모듈이 존재하지 않습니다. :" + exception.getMessage());
                            }
                            HUD.Log(" 주소 :" + localDevice.getBluetoothAddress());
                            HUD.Log(" 이름 :" + localDevice.getFriendlyName());


                                                         - 473 -
   468   469   470   471   472   473   474   475   476   477   478