In [1]:
using PiMath
using Gadfly
Some simple math
In [2]:
x=pi+2pi
Out[2]:
In [3]:
x/3
Out[3]:
Type promotion should work as expected
In [4]:
x-(4//3)*pi
Out[4]:
In [5]:
x+1
Out[5]:
In [6]:
y=2pi
x/y
Out[6]:
Exact results for sin and cosine of integer multiples of pi
In [7]:
(sin(2pi),cos(2pi))
Out[7]:
We can define Ranges
In [8]:
range1=linspace(0,4pi,100)
Out[8]:
And we get nice axes labels
In [9]:
y=sin(range1);
plot(x=range1,y=y)
Out[9]:
Same for arrays
In [10]:
pirange2=[x*pi for x=0:0.02:1]
plot(x=pirange2,y=cos(pirange2.*3))
Out[10]: