search algorithm in the volume of a cone.

5 ビュー (過去 30 日間)
Nikhil Tej
Nikhil Tej 2012 年 5 月 22 日
I am trying to for search algorithm to determine all the points that are available in the volume of a cone. I have flight simulated data of latitude, Longitude and altitude information for 3 minutes time interval generated every second . I would like to search for any of these locations that fall into the cone of specify volume considering that we have the location of the cone.
  2 件のコメント
Walter Roberson
Walter Roberson 2012 年 5 月 22 日
"all points" would be an infinite number unless you are using a discretized grid.
Geoff
Geoff 2012 年 5 月 22 日
It seemed that way in the first sentence, but the last sentence suggests that a point in/out test for a cone is required. I chose to interpret it that way, because the other interpretation is pretty illogical. =) I think it was just poor choice of wording.

サインインしてコメントする。

採用された回答

Geoff
Geoff 2012 年 5 月 22 日
Well, you need a point that defines the apex of the cone, a vector definining the cone's major axis, and the half-angle (angle between one edge of the cone and the major axis). If you're talking about cone volume, you also need to know how tall it is.
Consider also that latitude, longitude and altitude are actually spherical co-ordinates.
Anyway, if you know the half-angle, then you immediately have an in/out test. If you define your cone's major axis such that it begins at the apex and points in the direction that the cone expands, then you just need to find the angle between these two lines:
vec1 = testpoint - apex;
vec2 = coneaxis;
If the angle is less than or equal to the half-angle of the cone, the point is inside. Since some angle calculations also work on points inside the negative cone (out the other side), you should test that the dot product of those two vectors is positive.
If you have a base, you just need to project vec1 onto the normalised vec2 (with dot), which gives you the perpendicular distance of your point from the apex. If that is less than or equal to your cone's "height" then it is inside.

その他の回答 (1 件)

the cyclist
the cyclist 2012 年 5 月 22 日
It sound like this submission in the File Exchange might be helpful to you:

カテゴリ

Help Center および File Exchange3-D Volumetric Image Processing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by