Environment for creative processing of text
and numerical data | |
Area of a regular polygon of 100 vertices plotted inside a unit circle
Beginning status (before activation):
1 *
2 *PI=3.141592653589793
3 *p=100
4 *
5 *MAT K=ZER(p+1,2)
6 *MAT #TRANSFORM K BY if(J#=1)then(cos(I#/p*2*PI))else(sin(I#/p*2*PI))
7 *
8 *P(x,y):=MAT_K(x,y)
9 *Area=for(i=1)to(p)sum((P(i,1)*P(i+1,2)-P(i+1,1)*P(i,2))/2)
10 *
11 *Area=
12 *
Ending status (after activation):
1 *
2 *PI=3.141592653589793
3 *p=100
4 *
5 *MAT K=ZER(p+1,2)
6 *MAT #TRANSFORM K BY if(J#=1)then(cos(I#/p*2*PI))else(sin(I#/p*2*PI))
7 *
8 *P(x,y):=MAT_K(x,y)
9 *Area=for(i=1)to(p)sum((P(i,1)*P(i+1,2)-P(i+1,1)*P(i,2))/2)
10 *
11 *Area=3.1395259764657
12 *
Previous
| Next