Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 27.
- restart;
- R:=3;
- x:=t->R*(t-sin(t));
- y:=t->R*(1-cos(t));
- plot([x(t),y(t), t=0..6*Pi], color = black, scaling = constrained);
- 28.
- restart;
- f:=x->trunc((((1+sqrt(5))/2)^x-((1-sqrt(5))/2)^x)/sqrt(5));
- A:=[seq([x,f(x)], x=0..10)];
- plot(A, style = point, color = black);
- restart;
- f:=x-> f(x-2)+f(x-1);
- f(0):=0;
- f(1):=1;
- A:=[seq([x,f(x)], x=0..10)];
- plot(A, style = point, color = black);
- 29.
- restart;
- y:=x-> -(x^2-4*x)/(x-2)^2;
- a:=t-> 2+0*t;
- b:=t-> 0+t;
- A:=[seq([a(t),b(t)],t=-4..8)];
- plot([A,y(x)], x=-4..8, y=-4..8, color = black);
- 30.
- restart;
- with(plots):
- r:=(s,t)->4+s*cos(t/2);
- f:=(s,t)->t;
- h:=(s,t)->s*sin(t/2);
- plot3d([r(s,t),f(s,t),h(s,t)],s=-Pi..Pi,t=0..2*Pi,color=white, coords = cylindrical);
- 31.
- restart;
- with(plots):
- a:=1;
- implicitplot(r^2=2*a^2*cos(2*h), r=-2..2, h=0..2*Pi, color = black, coords=polar, numpoints = 2000, scaling = constrained);
- restart;
- with(plots);
- c := 1;
- implicitplot((x^2+y^2)^2 = 2*c^2*(x^2-y^2), x = -2 .. 2, y = -2 .. 2, scaling = constrained, gridrefine = 2, color = blue, numpoints = 2000)
- 32.
- restart;
- with(plots);
- k := 1;
- spiral := polarplot(k*phi, phi = 0 .. 12*Pi, axes = none, color = black):
- ball := proc (phi, ro)
- pointplot([[phi, ro]], color = red, coords = polar, symbol = circle, symbolsize = 30, axes = none)
- end proc:
- anim := animate(ball, [phi, k*phi], phi = 0 .. 12*Pi, scaling = constrained, frames = 150);
- spiral := polarplot(k*phi, phi = 0 .. 12*Pi, axes = none, color = black);
- display(anim, spiral);
- 33.
- restart;
- with(plots):
- with(plottools):
- a :=2:
- b := 1:
- N := 23:
- Ellipse := plot([a*cos(t), b*sin(t), t=0..2*Pi], color = blue):
- Ani := [seq(rotate(Ellipse, ((k-1))*Pi/N), k=1..N+1)]:
- display(Ani, insequence = true, scaling = constrained, axes = none);
- 34.
- restart;
- S:={x^2+2*y^2=17, x^2-2*x*y=-3};
- sol:=solve(S,{x,y}, explicit);
- assign(sol[1]);
- [x,y];
- 35.
- restart;
- urav:=x^3-(2*a-1)*x^2+x+(2*a+1)=0;
- sol:=solve(urav,x,explicit);
- urav2:=sol[1] + sol[2] + sol[3] = sol[1]^2 + sol[2]^2 + sol[3]^2;
- sol2:=solve(urav2, a, explicit);
- 36.
- restart;
- restart;
- result := 0:
- num_of_roots := 0:
- eqn := (x-1)^2 - (x^2-2*x)^3 = 1;
- sol := solve(eqn, x, explicit = true);
- sol := [sol];
- for i from 1 to nops(sol) do
- if trunc(sol[i]) > 0
- then result := result + sol[i];
- num_of_roots := num_of_roots + 1;
- end if:
- end do:
- result;
- num_of_roots;
- restart;
- result := 0;
- num_of_roots := 0;
- eqn := (x-1)^2-(x^2-2*x)^3 = 1;
- sol := solve({eqn, x > 0}, x, explicit = true);
- sol := [sol];
- sol := map(op, sol);
- sol := map(rhs, sol);
- for i to nops(sol) do
- result := result+sol[i];
- num_of_roots := num_of_roots+1
- end do;
- result;
- num_of_roots;
- 37.
- restart;
- with(plots):
- eqn1 := x^2 - 2*x*y + 2*y^2 = 6:
- eqn2 := x^2 - 2*y^2 + 8*x = -6:
- eqns := {eqn1, eqn2}:
- sol := solve(eqns, {x, y}, explicit = true, real);
- first := implicitplot(eqn1, x=-4..4, y=-4..4, color = blue, thickness = 2, gridrefine = 3, numpoints = 5000):
- second := implicitplot(eqn2, x=-4..4, y=-4..4, color = red, thickness = 2, gridrefine = 3, numpoints = 5000):
- display(first, second);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement