English 中文(简体)
三. 如果两点之间有争 ,则调查结果
原标题:Finding if an angle lies between two points

这基本上只是一个数学问题。

在这方面,我对......感到不安。 我有一段困难的时间来谈论这个问题,我也这样说。 基本上,我认为我需要利用一些先进的数学来做到这一点,但我不知道我需要什么。

I将使用一些插图说明这一点。 静脉预防使我不了解情况...... http://radleygh.com/images/gimp-2_2011-057-00-57-26-40.bmp”rel=“nofollow”http://radleygh.com/images/gimp-2_2011-057-00-57-26-40.bmp

<>>目标: 2. 确定在2D计划范围内的若干物体

Cone Properties: Position (x, y) Angle (0-359) Spread (0-359, aka Width) Distance (0++)

我可以使用简单的数学参数决定新陈词:

Angle_A = Angle + (Spread / 2) Angle_B = Angle - (Spread / 2) Angle_Target = Point_Direction(origin, object_position)

Now I thought of comparing these with the position of each object with a simple if/then statement:

如果(Angle_A > Angle_Target) && (Angle_B < Angle_Target) 见Angle_ 具体目标在A和B

This works... untill Angle_A or Angle_B pass the 0-360 threshold. 0* is between 45* and 315*... but the above if statement wouldn t work. We can then determine which direction to check based on the size of the cone...

如果效果大于180*,那么会怎样?

我不知道答案。 我肯定我应该利用Radians...... 但我不理解激进分子的概念。 如果有人能够把我引向正确的方向,也许会给我一个榜样,那将令人 wonder!

我将继续在时间进行自己的研究。

最佳回答

您可考虑一种简单的转变,它确立了协调制度,使Angle_B为零。 换言之,而不是测试

Angle_B < Angle_Target < Angle_A

也可使用

0 < Angle_Target - Angle_B < Angle_A - Angle_B

如果你对所有术语适用360度模块,那么逻辑应当做到:

0 < (Angle_Target - Angle_B) % 360 < (Angle_A - Angle_B) % 360
问题回答

一位盟友的视角是,用相当于这个圈子的长度追踪圈子。 因此,在一圈子里,只有2名扫盲者。

So 2*PI radians = 360 degrees

因此,将学位转换为rad,乘以2 (当然,由消费物价指数乘以180)。

然而,你是否从事rad或学位的工作,只能由你使用的图书馆决定。 即便如此,你也可以写出做上述计算工作的总结。

但是,问题主要部分。 认为:

sin (theta) = sin (360 + theta)。

co(theta)= co(360 + theta)。

etc.

因此,如果你走到你身上,就会达到0摄氏度,那么就只能增加360英寸。

e.g. if your cone goes from -10 to +20, simply use 350 to 380 instead. And of course, when you test an angle, make sure you also add 360 to that and test both the original and added angles.

例如,测试+5(在你看来),你将测试5(失败),然后是365(通过)。

亲爱!





相关问题
Bounding ellipse

I have been given an assignement for a graphics module, one part of which is to calculate the minimum bounding ellipse of a set of arbitrary shapes. The ellipse doesn t have to be axis aligned. This ...

Line segment in a triangle

How can we check if a line segment falls partially or fully inside a triangle? Cheers.

Line Segments from a point

I have a point p, and 2 line segments in a 2D plane. Point p is a location of view from where camera is looking towards the line segments. I want to check if line segment 1 is partially or fully ...

Creating a surface of triangles from a set of 2D points

I have a set of points and I need to convert the set to (non-overlapping) triangles (or a big polygon if equivalent)... The application: I have a list of locations (latitude,longitude) from a country,...

Radial plotting algorithm

I have to write an algorithm in AS3.0 that plots the location of points radially. I d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry ...

Delete holes in a Polygon

I have a polygon determined by an Array of Points. This polygon is crossing itself making some holes in the polygon itself. My questions is: How can I omit this holes and just get the exterior ...

Finding cycle of 3 nodes ( or triangles) in a graph

I am working with complex networks. I want to find group of nodes which forms a cycle of 3 nodes (or triangles) in a given graph. As my graph contains about million edges, using a simple iterative ...