Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

how can i create a circle with a radius leading to a point p with a tangent on the point p?

1 vue (au cours des 30 derniers jours)
Callum Davies
Callum Davies le 23 Déc 2022
Clôturé : John D'Errico le 23 Déc 2022
I need a script to create a circle from a fixed point defined 𝑥 = 𝑟 cos 𝜃 + 𝑥0 𝑦 = 𝑟 sin 𝜃 + 𝑦0 with a radius plotted between (𝑥0, 𝑦0 ) and (𝑥𝑃, 𝑦𝑃 ) and a tangent line (𝑥𝑡 , 𝑦𝑡) are defined as follows: When 𝑦𝑃 ≠ 𝑦0 𝑥𝑃 − 2 ≤ 𝑥𝑡 ≤ 𝑥𝑃 + 2 𝑦𝑡 = 𝑚𝑡 (𝑥𝑡 − 𝑥𝑃 ) + 𝑦𝑃, When 𝑦𝑃 = 𝑦0 𝑥𝑡 = 𝑥𝑃 𝑦𝑃 − 5 ≤ 𝑦𝑡 ≤ 𝑦𝑃 + 5.
The MATLAB script must include the following: • User input for o The radius of the circle o The coordinates of the centre of the circle o The coordinates of the point 𝑃 • All calculations, including the calculation for the gradient of the tangent • The commands to: o Create a single figure containing all three lines/curves o Create a legend on the figure o Label the figure axes o Choose appropriate limits for the axes to ensure the circle does not touch the axes at any point o Set the aspect ratio of the figure to be 1:1 (use the MATLAB help to find the correct command to do this) • Comments describing the code

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by