Coding to Plot Ellipse

24 ビュー (過去 30 日間)
Jared Candelaria
Jared Candelaria 2016 年 12 月 3 日
回答済み: Roger Stafford 2016 年 12 月 3 日
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?

回答 (3 件)

Star Strider
Star Strider 2016 年 12 月 3 日
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 2016 年 12 月 3 日
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 2016 年 12 月 3 日
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.)

カテゴリ

Help Center および File ExchangeAnimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by