Ellipse with a, b and angle between semi major axis and x-axis variable

Hi!
I want to plot an ellipse with origin at (0,0), semi major axis and semi minor axis needs to be a and b (length is a variable, and one can define it by writing a= for example 5 and b=10), and the angle between semi major (a) axis and x-axis is also a variable that I can define (for example 30 degrees)
Can someone please help me?

Answers (1)

Very straightforward if you download this,
plot( ellipticalFit.groundtruth([],[xcenter,ycenter],[a,b],angle) );

1 Comment

You may have to adjust the axes to get a good view of the ellipse, e.g.,
[a,b,angle,xcenter,ycenter]=deal(10,5,30,0,0)
plot( ellipticalFit.groundtruth([],[xcenter,ycenter],[a,b],angle) );
axis(a*[-1,1,-1,1])

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Asked:

on 4 Jun 2022

Commented:

on 4 Jun 2022

Community Treasure Hunt

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

Start Hunting!