Finding the tangent line of an ellipse
12 views (last 30 days)
Show older comments
I have to find the tangent line of an ellipse that I have written code for. The ellipse is parametrized, so I'm not sure how to write the code to find the tangent line. This is waht I have so far. What do you recommend I add to find the tangent line at the point (x(a),y(a))? Please respond as soon as possible.
function destin_ellipse(xRadius,yRadius)
c=sqrt(xRadius^2-yRadius^2);
theta = [0 : 0.01 : 2*pi]';
x = xRadius * cos(theta);
y = yRadius * sin(theta);
a=randi(300);
clf;
plot(x, y, 'LineWidth', 1);
hold on;
plot(x(a),y(a),'r.');
plot([-c x(a)],[0 y(a)],'g');
plot([c x(a)],[0 y(a)],'g');
plot(c,0,'r.');
plot(-c,0,'r.');
axis square;
grid on;
if xRadius>yRadius
xlim([-(xRadius+1), xRadius+1]); ylim([-(xRadius+1), xRadius+1])
else
xlim([-(xRadius+1), xRadius+1]);
ylim([-(yRadius+1), yRadius+1]);
end
0 Comments
Answers (1)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!