find angle between tangent and line
27 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sharatkumar Kondikoppa
am 25 Jan. 2022
Kommentiert: Sharatkumar Kondikoppa
am 3 Okt. 2023
I wanted to finding angle between camera center line (green vertical line ) and tangent(red line) drawn to the parabolic points (blue dots).But I am not finding any intersection point in it.Anyone can help me in finding angle ?
0 Kommentare
Antworten (1)
Milan Bansal
am 3 Okt. 2023
Hi,
I understand that you are trying to find the angle between the vertical line and the tangent line as you are unable to find the intersection point.
If the equations of the lines are present in "y = mx + b" format, find the intersection point of the lines as shown in the code below.
x0 = (b2-b1)/(m1-m2); %find the x point
y0 = m1*x0+b1;
Find another point on each of the two lines, (x1, y1) and (x2, y2).
Use the "atan2" function to find the angle between the lines using these points and the intersection point (x0, y0) calculated above.
v1 = [x1, y1, 0] - [x0, y0, 0];
v2 = [x2, y2, 0] - [x0, y0, 0];
Theta = atan2(norm(cross(v1, v2)), dot(v1, v2));
Refer to the below MathWorks documentation link to learn more about "atan2" function.
Hope it helps!
Siehe auch
Kategorien
Mehr zu Animation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!