562) (View other files uploaded by Mariner) The HTML version of this file is shown below. To use the contents of this file in a posting, click here to get the source code
The following procedure was inspired by a contribution by Will to MaplePrimes.
PiAxis(f(x),range,n)
f(x) - function to be plotted
range - x0..x1 - left end point to right end point of horizontal real range
n - positive integer; sets intervals on the horizontal axis to
.
The PiAxis(f(x),range,n) calling sequence plots the real function f(x) over the horizontal real range from x0 to x1; divides the horizontal (x) axis into intervals and labels them with multiples of
. If n is large, it may be necessary to enlarge the plot area to make the labels readable.
> restart;
> PiAxis := proc(f,range::range,n::posint)
local k, p, q, r, t, u, v;
r := subs(Pi=1,range);
u := op(1,r):
v := op(2,r):
if type(u,even) then q := n*u else q := 2*n*u end if;
t := [seq(evalf(k/n*Pi) = StringTools[Join]([(convert( (k/n),string)),"p"]),k= q..-1/n),
seq(evalf(k/n*Pi) = StringTools[Join]([(convert( (k/n),string)),"p"]),k=1..v*n) ]:
plot(f,x=range,tickmarks = [t,default],axesfont=[SYMBOL],colour=red );
end proc:
> PiAxis(sin(x),-Pi..Pi,4);

> PiAxis(cos(x),-2*Pi..2*Pi,3);

> PiAxis(sin(x),-7..7,2);

> PiAxis(tan(x),-3*Pi/8..3*Pi/8,8);

> f(x) := x^2 + 4;

> PiAxis(f(x),-Pi..Pi,4);

> PiAxis(,-Pi..Pi,4);

> circle := x^2 + y^2 = Pi^2;

> f := x-> sqrt(Pi^2 - x^2);

> plots[display]([PiAxis(f(x),-Pi..Pi,4),PiAxis(-f(x),-Pi..Pi,4)],title="Circle x^2 + y^2 = Pi^2");

>

This post was generated using the MaplePrimes File Manager
View 724_Pi axes.mw on MapleNet or Download 724_Pi axes.mw
View file details
Copy this code into any posting to insert this file into a posting on MaplePrimes
IMPORTANT INFORMATION
When pasting this code into a post on MaplePrimes, make sure that you choose the Worksheet HTML input format
The following procedure was inspired by a contribution by Will to MaplePrimes.
PiAxis(f(x),range,n)
f(x) - function to be plotted
range - x0..x1 - left end point to right end point of horizontal real range
n - positive integer; sets intervals on the horizontal axis to
.
The PiAxis(f(x),range,n) calling sequence plots the real function f(x) over the horizontal real range from x0 to x1; divides the horizontal (x) axis into intervals and labels them with multiples of
. If n is large, it may be necessary to enlarge the plot area to make the labels readable.
> restart;
> PiAxis := proc(f,range::range,n::posint)
local k, p, q, r, t, u, v;
r := subs(Pi=1,range);
u := op(1,r):
v := op(2,r):
if type(u,even) then q := n*u else q := 2*n*u end if;
t := [seq(evalf(k/n*Pi) = StringTools[Join]([(convert( (k/n),string)),"p"]),k= q..-1/n),
seq(evalf(k/n*Pi) = StringTools[Join]([(convert( (k/n),string)),"p"]),k=1..v*n) ]:
plot(f,x=range,tickmarks = [t,default],axesfont=[SYMBOL],colour=red );
end proc:
> PiAxis(sin(x),-Pi..Pi,4);

> PiAxis(cos(x),-2*Pi..2*Pi,3);

> PiAxis(sin(x),-7..7,2);

> PiAxis(tan(x),-3*Pi/8..3*Pi/8,8);

> f(x) := x^2 + 4;

> PiAxis(f(x),-Pi..Pi,4);

> PiAxis(,-Pi..Pi,4);

> circle := x^2 + y^2 = Pi^2;

> f := x-> sqrt(Pi^2 - x^2);

> plots[display]([PiAxis(f(x),-Pi..Pi,4),PiAxis(-f(x),-Pi..Pi,4)],title="Circle x^2 + y^2 = Pi^2");

>

This post was generated using the MaplePrimes File Manager
View 724_Pi axes.mw on MapleNet or Download 724_Pi axes.mw
View file details
Copy this code into any posting to share this file with other users
6 min 37 sec ago
14 min 9 sec ago
14 min 16 sec ago
51 min 51 sec ago
51 min 53 sec ago
1 hour 58 min ago
2 hours 11 min ago
2 hours 59 min ago
3 hours 10 min ago
3 hours 25 min ago