There are actually two types of numbers in PostScript, integers and reals. Integers are signed and reals are expressed in the usual mantissa E exponent fashion, such as 2.34E32. Type conversions are usually done for you; you divide and integer by a real with the same command that divides a real by a real. This shouldn't ever cause you any difficulty.
You should probably know something about PostScript's trigonometric functions. PostScript has only three trig functions: atan, cos, and sin. These are sufficient to generate any other trig function, however. For example, you could find the arcsine of 1/2 as in the following ghostscript session
GS>.5 GS<1>dup GS<2>2 GS<3>exp GS<2>1 GS<3>sub GS<2>neg GS<2>sqrt GS<2>atan GS<1>= 30.0Notice that the answer is in degrees. This is true for all trig functions: they expect arguments in degrees and they express angles in degrees.
![]() |
|