Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inner angle between two lines

Tags:

People also ask

How do you find the interior angle between two lines?

Formulas for Angle Between Two Lines The angle between two lines, of which, one of the line is ax + by + c = 0, and the other line is the x-axis, is θ = Tan-1(-a/b). The angle between two lines, of which one of the line is y = mx + c and the other line is the x-axis, is θ = Tan-1m.

How do you find the angle between two lines in C++?

double theta1 = atan(m1) * (180.0 / PI); double theta2 = atan(m2) * (180.0 / PI); After to know the angle I calculate the following: double angle = abs(theta2 - theta1);

What is the angle between two straight lines called?

One is an acute angle and another is an obtuse angle or equal. Both these angles would be supplements(Sum equals 180◦) of each other. By definition, when we say 'angle between two straight lines' we mean the acute angle between the two lines.


I have two lines: Line1 and Line2. Each line is defined by two points (P1L1(x1, y1), P2L1(x2, y2) and P1L1(x1, y1), P2L3(x2, y3)). I want to know the inner angle defined by these two lines.

For do it I calculate the angle of each line with the abscissa:

double theta1 = atan(m1) * (180.0 / PI);
double theta2 = atan(m2) * (180.0 / PI);

After to know the angle I calculate the following:

double angle = abs(theta2 - theta1);

The problem or doubt that I have is: sometimes I get the correct angle but sometimes I get the complementary angle (for me outer). How can I know when subtract 180º to know the inner angle? There is any algorithm better to do that? Because I tried some methods: dot product, following formula:

result = (m1 - m2) / (1.0 + (m1 * m2));

But always I have the same problem; I never known when I have the outer angle or the inner angle!