怎么知道汽车在高速公路上运行

编程入门 行业动态 更新时间:2024-10-22 22:56:28
本文介绍了怎么知道汽车在高速公路上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开始在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).

更多推荐

怎么知道汽车在高速公路上运行

本文发布于:2023-10-29 08:05:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539163.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:高速公路   汽车

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!