Drawing a second order curve

1 view (last 30 days)
Mirko Babanic
Mirko Babanic on 4 Apr 2021
Answered: Image Analyst on 4 Apr 2021
Is it possible and in what way to plot a second-order curve given in the implicit form.
The equation reads: a11*x.^2 +a22*y.^2+2*a12*x*y+2*a13*x+2*a23*y+α33= 0
The domains of the variables are: x(0:1), y(0:1)

Answers (1)

Image Analyst
Image Analyst on 4 Apr 2021
Here's a start. Adapt as needed:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format short g;
format compact;
fontSize = 18;
fprintf('Beginning to run %s.m ...\n', mfilename);
a = rand(3,3) - 0.5
[x, y] = meshgrid(linspace(0, 1, 100), linspace(0, 1, 100));
z = a(1,1)*x.^2 +a(2,2)*y.^2+2*a(1,2)*x*y+2*a(1,3)*x+2*a(2,3)*y+a(3,3);
surf(x, y, z);
grid on;
xlabel('x', 'FontSize', fontSize);
ylabel('y', 'FontSize', fontSize);
zlabel('z', 'FontSize', fontSize);
fprintf('Done running %s.m.\n', mfilename);

Categories

Find more on Develop Apps Using App Designer 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!