Finding the angle of inclination from two end points of a line.
32 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ba Ba Black Sheep!
el 19 de Jun. de 2017
Comentada: samundeeswari p
el 23 de Oct. de 2021
point1 = [22, 114];
point2 = [693, 233];
x1 = point1(1);
y1 = point1(2);
x2 = point2(1);
y2 = point2(2);
slope = (y2 - y1) ./ (x2 - x1);
angle = atand(slope)
Output
angle = 10.0567
This line has a negative slope. Why am I getting an incorrect answer?
3 comentarios
Respuesta aceptada
Andrei Bobrov
el 19 de Jun. de 2017
point1 = [22, -114];
point2 = [693, -233];
x1 = point1(1);
y1 = point1(2);
x2 = point2(1);
y2 = point2(2);
slope = (y2 - y1) ./ (x2 - x1)
angle = atand(slope)
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!