Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

All published worksheets from http://sagenb.org

189950 views
ubuntu2004

Parametric equations are equations in which the values of both xx and yy are determined by functions of some other variable, say tt:

x=f(t)x = f(t)

y=g(t)y = g(t)

Here are some sample function definitions for ff and gg:

f(t) = cos(3*t) g(t) = 3*sin(t)

This line creates a list of ordered pairs where x=f(t)x = f(t), and y=g(t)y = g(t):

domain = [0..2*pi, step = pi/180] P = [(f(t), g(t)) for t in domain]

And this line plots points constructed from those ordered pairs.

points(P).show(aspect_ratio = 1)

Feel free to explore this.  Modify parts of it and see what happens.  

Experiment with different function definitions for ff and gg.  Experiment with different domains for tt.

Don't worry about breaking the code.  You can always access the original file.

@interact def _(a = 4, b = 3, r = 1, s = 1): domain = [0..2*pi, step = pi/180] P = [r*(cos(a*t), s*sin(b*t)) for t in domain] show(points(P).show(aspect_ratio = 1))