我开始在Android上创建应用程序地图 所以,它只在高速公路上使用。 i不知道位置(经度和纬度)通过平板电脑上的GPS与os android在高速公路或普通街道上。 i有一个解决方案,在公路网关。我用旗子知道是高速公路。但是,这个区域太小了,无法检查这里的汽车,智能手机或平板电脑的Android Android和速度的汽车的GPS(例如:面积-30米,速度 - 40公里/小时[如此快速检查]) 请帮助我,解决方案可以在高速公路上知道汽车
i'm starting to create a application map on android so, it's use only on highway. i don't know location(Longitude and latitude) which get by GPS on tablet with os android is on highway or normal street. i have a solution, at highway gateway. i have use a flag to know is highway. But, the area is too small which to check the car at here with the deviations of GPS on smartphone or tablet of OS Android and speed's car(ex: area -30m, speed - 40km/h [so fast to check]) Please help me, what the solution can know the car on highway
推荐答案高速公路是宽度较大的线段,换句话说,是矩形。如果您知道矩形的位置和大小,则可以确定汽车的位置。 您需要高速公路的几何形状(应该是形成线段的多个点),为它们分配宽度并做到简单检测那个矩形内的一个点。 这是一个非常简单的概念,但困难的是矩形不是笛卡尔对齐的,而是游戏编程的世界有很多算法可以确定一个点是否在矩形内(碰撞检测)。 Highways are line segments with widths, or in other words, rectangles. If you know the position and size of the rectangle you can determine where the car is. You would need the geometry of the highway (which should be something like a number of points that form the line segments), you assign a width to them and do simple detection of a point inside that rectangle. This is a pretty easy concept, but the hard part is that the rectangles are not cartesian aligned, but the world of game programming has a lot of algorithms for determining if a point is inside a rectangle (collision detection).
更多推荐
怎么知道汽车在高速公路上运行
发布评论