Coding to Plot Ellipse

2 visualizzazioni (ultimi 30 giorni)
Jared Candelaria
Jared Candelaria il 3 Dic 2016
Risposto: Roger Stafford il 3 Dic 2016
okay so the question goes as follows:
Write a program, plotellipse.m that animates the plotting of the following parametrically defined motion characterized by T and ϕ. x = r*cos(ω*T) y = r*sin(ω*t+ϕ)
I'm confused cause I don't know what ϕ represents in this equation. Could someone explain how I might go about this?

Risposte (3)

Star Strider
Star Strider il 3 Dic 2016
The ‘ϕ’ in the equation is a phase term. It represents an ‘offset’ angle.
A relevant example is if ϕ=90° or ϕ=pi/2, cos(a)=sin(a+ϕ).

Image Analyst
Image Analyst il 3 Dic 2016
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_ellipse.3F To rotate the ellipse, add a phase to either the x or y inside the sin() or cos().

Roger Stafford
Roger Stafford il 3 Dic 2016
As you have written the parametric equations, for ϕ equal to zero you have a circle traced out with varying T. As ϕ increases, this figure becomes an increasingly eccentric ellipse that is gradually rotating counterclockwise. Finally with ϕ equal to pi/2 it degenerates into a straight line segment at a forty-five degree angle. With ϕ equal to pi it becomes a circle again but motion with varying T is in the opposite direction. For ϕ negative it goes through the same process in the opposite direction and becomes a straight line segment oriented at a minus forty-five degree angle and then on to a circle again. All of these figures will be contained in a square 2*r-by-2*r box centered at the origin.
(I have assumed here you meant “y = r*sin(ω*T+ϕ)” with uppercase T.)

Community Treasure Hunt

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

Start Hunting!

Translated by