Borrar filtros
Borrar filtros

How to write code for parametric equation

53 visualizaciones (últimos 30 días)
Eric Jackson
Eric Jackson el 31 de Mayo de 2015
Respondida: isku el 25 de Jul. de 2020
Hi, I need help to write the code to plot the curve and tangent line for t in the interval of [0, 2π].
This is the question:
Parametric equation of a curve is given by r(t)= 〈4 cos(t) ,2 sin(t) 〉. Determine the tangent vector at t = 2. What is the parametric equation of the tangent line at t = 2?
  1 comentario
John D'Errico
John D'Errico el 31 de Mayo de 2015
This is not a MATLAB question, but a basic one of mathematics. So can you tell us what the equation of that line would be in terms of mathematics? If you could, it would be trivial to write it in MATLAB. Therefore, you don't have a MATALB question at all. Time to review your notes or your textbook.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 31 de Mayo de 2015
x = r(t](1), y = r(t)(2), dx/dt = d r(t)(1) /dt, dy/dt = d r(t)(2) / dt. So calculate those to get a formula for dx/dt and dy/dt. Then evaluate at the given time t = 2 to get dx and dy as constants. Any tangent line must have the same slope as dy/dx (which are now constants), and as well must pass through r evaluated at the given t, becoming constants. You are now reduced to the task of finding the right intercept to complete y = m*x + b where m = known dy/dx and x = known r(t=2)(1) and y = known r(t=2)(2).
The "parametric equation" of the tangent line at a specific time makes no sense to me. The parametric equation of the tangent line at a symbolic time t would make sense and is easily answered using the above reasoning.

isku
isku el 25 de Jul. de 2020
My Code:
>> clear; syms t real;
r = [ 4*cos(t), 2*sin(t) ]
Dr = diff(r)
>> subs( Dr,t,2) % substitute at t=2
ans =
[ -4*sin(2), 2*cos(2)]

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by