how to draw hyperbola for diagonal points in matal

1 view (last 30 days)
sir, i have plotted the two hyperbola. one point at origin and other two at x and y axis respectively with a distance of 0.9 meters from origin.it is in the form of L shaped.I am unable to plot hyperbola for diagonal points i.e between $2 and $3 . please help me out.
here is code
clear % all variables figure(1), hold off % start a new figure set(gca,'FontSize',14) % adjust fontsize xmax = 30; ymax = 20; x = linspace(-xmax,xmax,1001); a = 0.28; b = 0.40; y=sqrt(((x.^2)./(b^2)+1).*a^2); % corresponding y values u1= plot(y,x); hold on % add to current plot u2= plot(-y,x); % Plot other half of hyperbola grid on set(gca,'FontSize',14) % adjust fontsize xmax = 30; ymax = 20; x = linspace(-xmax,xmax,1001); a = 0.26; b = 0.55; y=sqrt(((x.^2)./(b^2)+1).*a^2); % corresponding y values plot(-x,y,'m') hold on % add to current plot plot(x,-y,'m') % Plot other half of hyperbola grid on text(0,0,'$1'); %reperesents the 1st microphone at origin(0,0) text(0.9,0,'$2'); %reperesents the 2nd microphone at origin(0.5,0) text(0,0.9,'$3'); %reperesents the 3rd microphone at origin(0,0.5) legend('hyperbola1','hyperbola1','hyperbola2','hyperbola2');

Answers (0)

Community Treasure Hunt

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

Start Hunting!