开发者

Getting coordinates that are in sight based on current location and heading

开发者 https://www.devze.com 2023-03-16 05:00 出处:网络
I\'m c开发者_Go百科urrently stuck as I don\'t really know what to use as a search term on Google for this.

I'm c开发者_Go百科urrently stuck as I don't really know what to use as a search term on Google for this. Let's say I retrieve the user's location and heading through a CLLocationManager and then want to calculate what coordinates are in the user's FOV - or if it's easier - check if a given coordinate is in the user's FOV.

How could I solve this? Any advice/links to documentation is appreciated.

Thanks!


You probably need to specify a maximum distance and an angle. Then you can calculate if a coordinate is in the field of view by checking that the distance between the user and the point is within the specified maximum distance and that the angle between is within the specified region.

The wikipedia article on Field of view gives a nice example for doing the calculations.

0

精彩评论

暂无评论...
验证码 换一张
取 消