我想以某种方式检索一个对象,该对象表示从纬度/经度到特定方向的直线。有了这个对象,我希望能够在指定的距离(向前10米或我指定的任何距离)移动它。这条线不必围绕地球或任何东西,只需距离原始起点约25公里。
例如,我想做一些像(不是真正的代码)的事情:
//startingLocation = GPS location object
double degrees = 98.1;//cardinal direction from this point (magnetic, could be converted to true)
LineObject line = new LineObject(startingLocation, degrees);
Location movedToLocation = line.move(5);//move 5 km up the line and return those GPS corrdinates as a Location
Log.i(LOG_TAG, "5 km away point: "+movedToLocation.latitude+" - "+movedToLocation.longitude);
这怎么可能?