Reference Guide

Full Command and Function Reference 3-13
characters), as might have been left on the stack by entries when running in algebraic mode, will
be ignored.
Access: ( îis the left-shift of the `key).
Input/Output:
Level 1/Argument 1 Level 1/Item 1
n
obj
n
See also: LAST, LASTARG, PICK
APPLY
Type: Function
Description: Apply to Arguments Function: Creates an expression from the specified function name and
arguments.
A user-defined function f that checks its arguments for special cases often can’t determine
whether a symbolic argument x represents one of the special cases. The function f can use
APPLY to create a new expression f(x). If the user now evaluates f(x), x is evaluated before f, so
the argument to f will be the result obtained by evaluating x.
When evaluated in an algebraic expression, APPLY evaluates the arguments (to resolve local
names in user-defined functions) before creating the new object.
Access: …µ
APPLY
Input/Output:
Level 2/Argument 1 Level 1/Argument 2 Level 1/Item 1
{ symb
1
... symb
n
}
'name'
'name(symb
1
... symb
n
)'
Example: The following user-defined function Asin is a variant of the built-in function ASIN. Asin checks for
special numerical arguments. If the argument on the stack is symbolic (the second case in the case
structure), Asin uses APPLY to return the expression 'Asin(argument)'.
« → argument « CASE -3 FS? THEN argument ASIN END
{ 6 7 9 } argument TYPE POS THEN
'APPLY(Asin,argument)' EVAL END
'argument==1' THEN 'π/2' END
'argument==-1' THEN '-π/2' END
argument ASIN
END » »
`OAsinK
See also: QUOTE, |
ARC
Type: Command
Description: Draw Arc Command: Draws an arc in PICT counterclockwise from x
θ1
to x
θ2
, with its center at
the coordinate specified in argument 1 or level 4 and its radius specified in argument 2 or level 3.
ARC always draws an arc of constant radius in pixels, even when the radius and center are
specified in user-units, regardless of the relative scales in user-units of the x- and y-axes. With
user-unit arguments, the arc starts at the pixel specified by (x, y) + (a, b), where (a, b) is the
rectangular conversion of the polar coordinate (x
radius
, x
θ1
). The resultant distance in pixels from
the starting point to the center pixel is used as the actual radius, r'. The arc stops at the pixel
specified by (r', x
θ2
).
If x
θ1
= x
θ2
, ARC plots one point. If |x
θ1
– x
θ2
| >360 degrees, 2π radians, or 400 grads, ARC
draws a complete circle.