| | |
| | | |
| | | |
| | | |
| | | ; |
| | | String str = "{\"result\":true,\"data\":{\"server\":\"gps.safeluck.com\",\"port\":\"3301\",\"map_json\":{\"axial\":[0.0,12.0],\"left_front_tire\":[8.0,9.0],\"main_ant\":[-9151.5063,13030.5118],\"right_front_tire\":[20.0,21.0],\"right_rear_tire\":[22.0,23.0],\"name\":\"科二场考车模型\",\"left_rear_tire\":[10.0,11.0],\"type\":\"car\",\"body\":[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0],\"point\":[-9149.6063,13033.0768,-9149.9978,13033.3124,-9150.3258,13033.3485,-9150.8341,13032.8985,-9151.7318,13031.6639,-9152.3573,13030.83,-9152.5214,13030.5639,-9152.602,13030.3105,-9150.8053,13032.8843,-9150.6537,13032.7602,-9152.3352,13030.8124,-9152.221,13030.7008,-9152.092,13029.7892,-9151.4638,13029.4333,-9151.2111,13029.568,-9150.9808,13029.8341,-9150.3546,13030.6796,-9149.458,13031.8642,-9149.1611,13032.4276,-9149.2827,13032.7653,-9149.4842,13031.8708,-9149.6176,13031.9937,-9151.0011,13029.8717,-9151.1367,13029.9878]},\"pzh\":\"豫E8000测\"}}"; |
| | | String pattern = "(\\d{1,2}\\.[0]{1})"; |
| | | Pattern r = Pattern.compile(pattern); |
| | | Matcher m = r.matcher(str); |
| | | int i= 0; |
| | | |
| | | while (m.find()){ |
| | | i++; |
| | | str = m.group(); |
| | | System.out.println(m.matches()+" str="+str); |
| | | } |
| | | System.out.println(m.matches()+" i="+i); |
| | | |
| | | |
| | | } |
| | | |
| | | public static Point Calc3Point(Point p1,Point p2,double L ){ |