HomeMapIndexSearchNew sArchivesLinksAbout LF[Top Bar]
[BottomBar] 
 
[Photo of theAuthor] 
Emre Demiralp 
�� ������: ������� �������� "American Robert College" � ��������. ���� �� ��������������� ������������ ����������� ���������� ��������� � ����� ������������� ������������ ������������. ����� ������������ ������, ������������ � ���� ������������, ����� ����� ������������� LINUX. ��������: PovRay, PostScript, ��������, ������ CD, ����������������, ���������� � ����. ������������ Linux � 1994.

����� � ������� 

��������

��������������� ������

�������������� ��������

 

���� ��������� PostScript:  ����������� � �������������� ��������

-������ ������ � ����� "PostScript"-
[Ilustration] 
����� ������ ����� 
-���������-
���������: ����� ��������� ���� ��������� ����� PostScript. ������������ �������� ����������� �� ������ � �������������� ��������. ������ ���������� �� ��� �������� ����� ���������. ��������� ������ ��������� ��� ����. 
 
 


��������

��� --- ������ � ����� ������ � PostScript. �������� �� ���� ����������� � ������������ �������� �� ������. ���� ���������, ��������, ����� ������ ����� PostScript. ������������, �������������� ��� �������������� ��������, ����� � ���������� �������� --- ��� �������� � ���� ����������� ������ ������. ��� ������������ PostScript ��� ���������� ����������� ����� ����, ��� �� �� ���� �����. ���� ������ ���������� ���, ��� ������, ���������� ����������, ��������� �������. �� ������ ����������� ���� ��� � ���� ����� � ����� �������� ������. ����� �� ��������� ���-������ � ��� �����, ��� ������������ ��� �� ���������� � ��������� �����, ����� ���������� ���� �����. ����� ������� ��������� ����������� ������� ������ ����� ��������� � ��������� �����. ���������� ����� ����� ���� �������, �������� ���������, �����, �����, � ��� �����.

��������������� ������

�������� �� ��, ��� �������� �� ����� �����������, ���������� ��������� �������� ��������, ����������� ��� �� ���������������. �������� ����������� � ������ ��� ���������� ��������� �� �����. ���������, �� �����������, �������� � ���������� �� �����. ��� ����� ��������� ��������� (�������� � ������������ PostScript), � ����� --- ���, � ����������� �� ��������. ���� ��� ������� ���������, ��� ������ ���� �������� �� ���� ����� �� �������. �������� ����� �������� � ����� ����������. ����� �� �������� ������ ����� ���������� � ������������ �����������. ����� �� ����� ��������� �������� ��� ���������� ������������.

pop: ���� �������� ������� ������� (���������� ���������) ������� �� ����� ���������.

exch: ���� �������� ������ ������� ��� ������� �������� ����� ���������.

dup: ���� �������� ������� ����� �������� �������� ����� ��������� � ������ ��� �� ����. ������� �������, �� ��������� ������� �������.

copy: ���� �������� ������� ������ �������� (���������), ������� ������ ���� ������� �� ���� ��������� �� ������ ���������. ������, ���� �������� ����� n, �� �������� ������ ������������ ��� n copy. ����� ��� ���������� n ������� ��������� ����� ����� ����������� � �������� �� ����. ������� �������, copy ��������� ����� ���������.

index: ���� �������� ������� ������ �������� (���������), ������� ������ ���� ������� �� ���� ��������� �� ������ ���������. ������, ���� �������� ����� n, �� �������� ������ ������������ ��� n index. ����� ��� ���������� n-��� ������� �����, ������ ������, ����� ���������� � ����� �������� ������ �� ����. ������� �������, index �������� ���������� ������� � ������ �� ���� ��� �����. ������� ��������� ���������� � 0 ��� ������ �������� ��������.

roll: ���� �������� ������� ���� ����� ��������� (����������), ������� ������ ���� �������� �� ���� ��������� �� ������ ���������. ������, ���� ��������� ����� nm, �� �������� ������ ������������ ��� m n index. ����� m ������ ���������� ����������� � �������� ���������, � n --- ���������� �����. ������ ��� ������������ ���, ��� ������� ������� ����� ���������� m-���, � ����� �� m-1 ��������� ��� ����� ������� ���������� �� ���� ����� �����. ���� n ����� 2, �� ����������� ��� ����� ����. ����� �������, m 2 roll ������������ m 1 roll m 1 roll. �������� n ����� ��������� ������������� ��������. � ���� ������ �� �������� ����������� ����������� ��������� �� ��������. ��� ������, ��� ������� m n roll m -n roll ��������� ���� ��������� ����������. ������� ��������� ���������� � 0 ��� ������ �������� ��������.

clear: ���� �������� ������� ��� �������� �� ����� ���������.

count: ���� �������� ������� �������� �� ����� ���������. ��������� �������� �� ���� � ���� ������ ��������. ���� ��� �� ����� ���� ����� �������, �� ������ ��������� ��������� ������� count pstack pop, ��� pop ������� ����� �������, ��������� �������� count, ����� ����, ��� ��������� �������� ���������� ��� ������ ��������� ��������� pstack.

mark: ���� �������� ������ �� ���� �������-������ (-marktype-). ����� ������� ����� ������������ ��� ������� ��������� ��������� �� ������������. ��� ������ ��������� cleartomarkcounttomark ���� ���� ������� � ���������� ������, ���� �� �������.

cleartomark: ���� �������� ������� �� ����� ��� ��������, ������� � �������� � �� ������� ��������-�������. ��� ������ -marktype- ���� ���������. ���� �� ����� ��� ������ �������, ���������� ������.

counttomark: ���� �������� ������� ��������, ������� � �������� � �� ������� ������������ �������. ����������� �������� ����� ��������, ������� �������� �� ���� ������� ���������. ��� ������-������ �� ���������� � �������. ���� �� ����� ��� ������ �������, ���������� ������.

���� �� ������ ������� ������������� ��������� � ������, ��� ����� ��������� ������������� PostScript. ��� ����������� � ������ ������, � ���� Linux ������ ������������ ������������� ������������� Ghostscript. Ghostscript ����� ��������� ��-�������, ������� ��������������� ��������� � ��������� �������. ������ �� ������ ���������� ������� gs � ����� X Window. ������ ��� �� �������� ��-�� ������� � ������������� X. ����� ��������� ��������� � ������������� ������� ����������� �������. ����� ����� ��������� �������� ��� ������ ��������� ghostscript ������������ ���������� x11. ��� ����� ������� gs -sDEVICE=x11. ��� �������, ��� ������ ������� gs, ������� ����� ������ ����, ������� ������������ ��� ������ �� ����� ������. ��� ��� � ����� ������ �� ������������� ��������� ���������, ��� ���� ��� �� ����� � ����� �� ���� ����������. ��� ����� ������������� ����� ��������� � ���������� -dNODISPLAY. ��� ���� ��������� ��������� � ����� --- ����������� GS>. � ����� ������� ghostscript ����� ��������� ���� �������. ���� ��������� ����.

����� ������� ���������� ����� ���������, ������������ �������� �������� pstack. �� ���������� ��������, ������ ��� �������� ���������� � ���������� ����� � ����������� �������� ����, �� ��������� --- �� �����. ���� �� ������� ��� �������, ������ �� ������������, � ���������� ����� ����������� GS>. ��� ������, ��� ���� ��������� ����.

����� �������� �������� �� ���� ���������, ������� �������� ����� �����������. ��������, ���� �� ������ �������� 1, ������ ������� 1. ����� ����� ��������� ����� �����������. ��, �� ���� ���, ����������� �������� ���: GS<1>. ��� ����� ����������� �������� ����� ��������� �� ����� ���������. ��� ���, ���� � �����-�� ������ ����� ������ ����������� ����� ��������� ��� GS<123>, �� ��� ����� �������, ��� �� ����� ��������� � ��� 123 ��������.

�� ������ ������� ����� ��������� ���������. ��� ����� ������� �������� ������, ����������� ���������. ��������, ���� �� ������� ����� ����������� 1 2 3 4 5 6, �� �� ���� �������� �������� 1, 2, 3, 4, 56. ���� �� ������ ��������� ������� pstack, �� ����� �������� ��� ��������, ��� ��� �������, ��������� ���������, ����� ������� ������. ��� ��� �������� ����� ������:

GS>1 2 3 4
5 6 
GS<6>pstack
6
5
4
3
2
1
GS<6>
����� ��� �� ����� ������� �������� � �������� ���������� ����� ����� ��������. ���, ��� ����� �������, --- ��� ���� ������� pstack ����� ��������� ���������. �� ����:
GS>1 2 3 4 5 6 pstack
6
5
4
3
2
1
GS<6>
�� ��� ��� � �������� ��������� �� ������������ �����. ����� ������������ ������ ���� ���������, ��������, ����������, ��� �����, �������, ����� � �.�. ����� �� �������� � ��� � ������������. ������ ���� �������, ��� ���� �� ����������� ������ ��������� ����� a ��� ������� abc, �� �������� ��������� �� ������. ���� ��� ����� ������� �������, ����� ��������� �� � ������� ������. ���� �� �������� � ����������� ��������-�������. ��� ������ ������ � ��� �������������:
GS>1 2 3 mark 4 5 6 pstack
6
5
4
-marktype-
3
2
1
GS<7>
��������� ������ �� ��������� ������� ������������� ���������� ����������� �� ������.
GS>1 2 3 mark 4 5 6 pstack
6
5
4
-marktype-
3
2
1
GS<7>pop pstack
5
4
-marktype
3 
2
1
GS<6>exch pstack
4
5
-marktype
3
2
1
GS<6>dup pstack
4
4
5
-marktype-
3
2
1
GS<7>2 copy pstack
4
4
4
4
5
-marktype
3
2
1
GS<9>5 index pstack
-marktype-
4
4
4
4
5
-marktype
3
2
1
GS<10>cleartomark cleartomark pstack
3
2
1
GS<3>3 1 roll pstack
2
1
3
GS<3>count pstack
3
2
1
3
GS<4>mark 7 8 pstack
8
7
-marktype-
3
2
1
3
GS<7>counttomark pstack
2
8
7
-marktype-
3
2
1
3
GS<8>clear pstack
GS>

�������������� ���������

����� �������� ����������� �� ������, ���������� ����� �������������� � �������������� ���������. ���� ��� �� ��������. ������� �� ���������� � �������� ���������� ��������, ������� ������ ������ ����� �� �������������, ����� � ��������������� ������ ������.

add: ��� ������� ��������� ��� �������� ���������. ���� �� ��������, ������, mn, �� ������� �������� ��� m n add. ��� ���� ������� m, � ����� n �������� �� ����. ����� ��� ���� ����������� �������� add. �� ������� ����� ������� �� ���������, ������ ����� mn. ����� ���������� ��������, mn �� �������� �� �����. ������ ��� ������� ��������� ����� ���������� ���������.

div: ��� ������� ��������� ��� �������� ���������, ����������� � �������� �������. ���� �� ��������, ������, mn, �� ������� �������� ��� m n div. �������� ��� ��, ��� � ��� add. �������� ����� ����� � ��������� ������. ����� �� ���������� �� ����� �������� ������ �� ���������, mn ���������.

idiv: ��� ������� ��������� ��� �������� ���������, ����������� � �������� �������������� �������. ���� �� ��������, ������, mn, �� ������� �������� ��� m n div. ��� ��� ��, ��� � div, ����� ����, ��� ������� ����������� � ����� ������. ��� �������� ��� ��, ���� ���� ��������� �� �������������.

mod: ��� ������� ��������� ��� ����� ���������. ��� ��������� ������� �� ������� ������� ��������� �� ������. ���� ����� �� ���������� �� �������� ����� ������, �������� �� ��������. �� ����� �������� ������ ���������.

mul: ���������� adddiv. �������� ��������, ��������� ���� �������� ��������. ����������� �������� �� ������������, ����������� �� �����.

sub: ���������� add, divmul. ������� ������ � ���� ��������: ��� �������� �������� ������� ��������� �� �������� �������. ��������� ����������� �� ����� ���������.

exp: �������� �������������� ��������. ��������� ��� ���������. ������ --- ���������, ������ --- �������. �� �������� �������� ��������� � �������, ���������� �������� ������� ��������. ��������� ������ ���� � �������� ����������� �������� ���������� � �������. ����������� �������� ����� � ��������� ������, ����������� �� �����.

atan: This is another binary mathematical operator for the evaluation of an angle. The angle is given in degrees between 0 and 360. It needs two parameters. The ratio of the first parameter to the second equals the tangent of the angle to be evaluated. Any one of the parameters may be zero but both cannot be given  zero values. The signs of the parameters determine the quadrant where the result will lie. The positive values in the first parameter corresponds to positive y plane. Whereas, the positive values in the second parameter mean positive x plane. 

abs: ������� �������������� ��������. �� ��������� ���� ��������, ��� ���������� �������� �������� ��� �����������. ��� ��, ��� � ������, ��������� ����������� ��� ����� ������� �� ����� ���������.

neg: ������ ���� ������ ������������� ���������. ������� �������������� ��������.

ceiling: ������� ��������, ����������� ��������� ������ � �������� ����� �����.

floor: ������� ��������, ����������� ��������� ����� � �������� ����� �����.

round: ������� ��������, ����������� ��������� � �������� ����� �����.

truncate: ������� ��������, ��������� � ������ ��������� ������� �����.

sqrt: ������� ��������, ����������� ���������� ������ ������ ���������.

cos: ������� ��������, ����������� ������� ������ ���������. �������� ��������� �������� � ��������.

sin: ������� ��������, ����������� ����� ������ ���������. �������� ��������� �������� � ��������.

ln: ������� ��������, ����������� ����������� �������� ������ ���������.

log: ������� ��������, ����������� ���������� �������� ������ ���������.

������, ��� ��������� ��� ������, ��� ���� ���������. ���� �� ���, ��������, ������, ��������� �� ����, ��������� (�������� � ������������ PostScript) ������ ����� ��������� ��������� ���������� ��������. ������� (�������� � ������������ PostScript) ���� ���� ��������� �� �����. ����� ����� ��� ������������ � ��������� �� ����� ���������. ��� ���, �����, ���������� ��� �� ������, �������, ��������� ����������, ���������� ���� ��� �������� ����������, ��� ��� ������������� �� ������, ���� ��, ��� �������� �� ������� �����, �� �������� �� ����, ��� ������ ������ ������� �������� �����. ������������ ������ ���� ����� ����������.

���, ��� ����� ������������������ � PostScript, �� ����������� ������ ����� ������� ���������. � ��������� ������� ���� ����� �� ��������� ������� � ����� PostScript. ���� ������� � ����������� ����� � ������������� ���������.

Reviewed by Jorge M. Paolo and Jose Quesada

�������: Boris Tobotras

 
This website is maintained by Miguel Angel Sepulveda 
© Emre Demiralp 1999 
LinuxFocus 1999