How to draw a tangent using a point and an angle?

3 visualizaciones (últimos 30 días)
Neha Sinha
Neha Sinha el 2 de Mzo. de 2019
Comentada: Star Strider el 4 de Mzo. de 2019
I need to draw a tangent from (0,0) with an angle of 89.8412 as shown in the curve. How to do that?
img.PNG

Respuesta aceptada

Star Strider
Star Strider el 2 de Mzo. de 2019
Try this:
ad = 89.8412; % Angle (Degrees)
tangline = 200*[0 cosd(ad); 0 sind(ad)];
figure
plot(tangline(1,:), tangline(2,:))
grid
axis([0 2 0 300])
It produces two vectors in the ‘tangline’ matrix, the first row being the x-coordinates and the second row the y-coordinates. It then plots them.
You can check that these are correct with:
Check = atan2d(diff(tangline(2,:)), diff(tangline(1,:)))
It returns the ‘ad’ value.
  13 comentarios
Neha Sinha
Neha Sinha el 4 de Mzo. de 2019
Thank you so much
Star Strider
Star Strider el 4 de Mzo. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by