find angle between tangent and line

29 visualizzazioni (ultimi 30 giorni)
Sharatkumar Kondikoppa
Sharatkumar Kondikoppa il 25 Gen 2022
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 ?

Risposte (1)

Milan Bansal
Milan Bansal il 3 Ott 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!

Categorie

Scopri di più su Animation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by