search algorithm in the volume of a cone.

조회 수: 4 (최근 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 CenterFile Exchange에서 3-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