Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¸ù¾Ý¾­Î³¶ÈÇóÁ½µã¼ä¾àÀëʵÏÖÔ´Âë(java)


Ñо¿ÁËÒ»ÏÂGoogle
MapÉϵĸù¾Ý¾­Î³¶ÈÇóµØÇò±íÃæÁ½µã¼ä¾àÀëµÄʵÏÖ£¬ ÓÃjavaʵÏÖÁËÒ»°Ñ£¬¶ÔÎÒ¹ú¾³ÄÚµÄBeijing54, Xian80,WGS84ÈýÖÖ×ø±êϵµÄ¿Õ¼ä¾àÀë¼ÆËã¸Ð¾õÕâ¸öʵÏÖÊDZȽÏ׼ȷµÄ¡£µ±È»£¬ÕâÀïÖ»ÊǸöÈ˵ĸоõ¶øÒÑ¡£¡£¡£¿ÉÄÜÎÒ»¹Ã»ÓÐÓöµ½ÄÇÖÖ¶Ô¾«¶ÈÒªÇó·Ç³£ÑϸñµÄµØ·½£¬»òÐí£¬±¾ÉíÎÒÕâ¸ö·½Ê½¾ÍÊÇ´íÎóµÄ¡£¡£¡£ºÇºÇ¡£¡£¡£ÕâÀïÖ»ÊÇ×÷¸ö¼ÇºÅÏÈ¡£¡£¡£¸÷λ´ïÈ˶à¶àÖ¸½Ì
package
com.geotools.test;
public class GeoUtils {
    public
enum GaussSphere{
        Beijing54,
        Xian80,
       
WGS84,
    }
    private static double Rad(double d){
        return d
* Math.PI / 180.0;
    }
 public double DistanceOfTwoPoints(double
lng1,double lat1,double lng2,double lat2,
   GaussSphere gs){
       
double radLat1 = Rad(lat1);
        double radLat2 = Rad(lat2);
       
double a = radLat1 - radLat2;
        double b = Rad(lng1) -
Rad(lng2);
        double s = 2 *
Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) +
         Math.cos(radLat1) *
Math.cos(radLat2) * Math.pow(Math.sin(b/2),2)));
        s = s * (gs ==
GaussSphere.WGS84 ? 6378137.0 : (gs == GaussSphere.Xian80 ? 6378140.0 :
6378245.0));
        s = Math.round(s * 10000) / 10000;
        return
s;
 }
}


Ïà¹ØÎĵµ£º

½âÎöJava¶ÔÏóµÄequals()ºÍhashCode()µÄʹÓÃ

ǰÑÔ
ÔÚJavaÓïÑÔÖУ¬equals()ºÍhashCode()Á½¸öº¯ÊýµÄʹÓÃÊǽôÃÜÅäºÏµÄ£¬ÄãÒªÊÇ×Ô¼ºÉè¼ÆÆäÖÐÒ»¸ö£¬¾ÍÒªÉè¼ÆÁíÍâÒ»¸ö¡£ÔÚ¶àÊýÇé¿ö Ï£¬ÕâÁ½¸öº¯ÊýÊDz»Óÿ¼Âǵģ¬Ö±½ÓʹÓÃËüÃǵÄĬÈÏÉè¼Æ¾Í¿ÉÒÔÁË¡£µ«ÊÇÔÚһЩÇé¿öÏ£¬ÕâÁ½¸öº¯Êý×îºÃÊÇ×Ô¼ºÉè¼Æ£¬²ÅÄÜÈ·±£Õû¸ö³ÌÐòµÄÕý³£ÔËÐС£×î³£¼ûµÄÊǵ± Ò»¸ö¶ÔÏó±»¼ÓÈ뼯ºÏ¶ÔÏó£¨collectio ......

Ubuntu java¿ª·¢»·¾³´î½¨

jdkµÄ°²×°
1¡¢´Ójava.sun.com¸ãÏÂjdk×îеİ汾£¬Ò»°ãÎÒÃÇÓÃ1.6°æ±¾µÄ£¬ÏÂÔØbin¸ñʽµÄjdk£¬¼Ù¶¨ÏÂÔØµÄÎļþÃûΪjdk-6u20-linux-i586.bin¡£
2¡¢chmod u+x jdk-6u20-linux-i586.bin;È»ºó  ./jdk-6u20-linux-i586.bin ½âѹ£¬¼Ù¶¨½âѹºóµÄÎļþ¼ÐΪ jdk1.6_20;
3¡¢ÔÚ/usr/local/  ½¨Á¢Ò»¸öinstallµÄĿ¼£¬ È»ºó°Ñ½âÑ ......

[JAVA] Éî¿Ë¡ ÁíÍâʵÏÖ·½·¨¡¾ÐòÁл¯¡¿

private static List cloneObject(
   Object obj) throws Exception {
  ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
  ObjectOutputStream out = new ObjectOutputStream(byteOut);
  out.writeObject(obj);
  ByteArrayInputStream byt ......

C#ºÍJavaµÄ±Õ°ü£­Jon̸¡¶The Beauty of Closures¡·


Ô­ÎÄ£ºhttp://csharpindepth.com/Articles/Chapter5/Closures.aspx
µÚÒ»¶ÎÂÔ¡£¡£¡£
´ó¶àÊý½²±Õ°üµÄÎÄÕ¶¼ÊÇ˵º¯ÊýʽÓïÑÔ£¬ÒòΪËüÃÇÍùÍù¶Ô±Õ°üµÄÖ§³Ö×îÍêÉÆ¡£µ±ÄãÔÚʹÓú¯ÊýʽÓïÑÔʱ£¬ºÜ¿ÉÄÜÒѾ­Çå³þÁ˽âÁËʲôÊDZհü£¬ËùÒÔÎÒÏëдһƪÔÚ¾­µäOOÓïÑÔ³öÏֵıհüÓÐʲôÓô¦Ó¦¸ÃÒ²ÊǺܺÏÊʵÄÊÂÇé¡£ÕâÆªÎÄÕÂÎÒ×¼±¸½²Ò»ÏÂC#£¨1¡ ......

JavaÎÊÌâ¾­µä32ÎÊ

JavaÎÊÌâ¾­µä32ÎÊ
    µÚÒ»£¬Ì¸Ì¸final£¬ finally£¬ finalizeµÄÇø±ð¡£
    µÚ¶þ£¬Anonymous Inner Class £¨ÄäÃûÄÚ²¿Àࣩ ÊÇ·ñ¿ÉÒÔextends£¨¼Ì³Ð£©ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements£¨ÊµÏÖ£©interface£¨½Ó¿Ú£©£¿
    µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ£¨ÃæÊÔÌâÓе ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ