point -- generate a graphical
point primitive
Introductionpoint(x, y) defines a 2D point with the
coordinates x and y.
point(x, y, z) defines a 3D point with the
coordinates x, y and z.
Call(s)point(x, y <, Color = [r, g,
b]>)
point(x, y, z <, Color = [r, g,
b]>)
Parametersx, y, z |
- | real numbers |
OptionsColor = [r, g,
b] |
- | sets an RGB color given by the amount of red, green,
and blue. The parameters r, g, b
must be real numbers between 0 and 1. |
Returnsan object of type DOM_POINT.
Related
Functionsplot, plot::Point, plot2d, plot3d, plotfunc2d, plotfunc3d, polygon, RGB
Detailspoint defines a 2D or 3D point. It can be displayed
graphically via plot2d/plot3d using the list format
[Mode = List, [..points..]].The coordinates and color values must be numerical
expressions that can be converted to real floating point numbers.
Symbolic expressions such as PI + 1,
exp(sqrt(2)) etc. are accepted and converted to floating
point numbers automatically. Note, however, that expressions involving
symbolic identifiers are not accepted! Cf. example 3.
plot library
provides the alternative point primitive plot::Point. This object is more
flexible than the kernel object generated by point. The
first can be used with all functions of the plot library, whereas the latter can
only be used in a call to plot2d or plot3d.point is a function of the system kernel.
Option: Color = [r, g, b]r, g, b
must be numerical expressions that can be converted to real floating
point numbers from the interval [0.0, 1.0]. An error occurs
if any of these values is not in this range. Symbolic expressions such
as PI - 2, exp(-sqrt(2)) etc. are accepted.
Note, however, that expressions involving symbolic identifiers are not
accepted! Cf. example 3.RGB
contains many pre-defined colors.The first two, respectively three, operands of a point are the
coordinates. The last operand is the list [r, g, b]
defining the point color. This operand is NIL if no color was specified.
Example
1point with two arguments defines a 2D
point:
>> point(1, PI)
point(1, 3.141592654)
Points generated by point represent
graphical primitives that can be displayed via plot2d and plot3d using the list format
[Mode = List, [..points..]]:
>> plot2d(Scaling = UnConstrained, PointWidth = 30,
[Mode = List, [point(i/10, sin(i/10)) $ i=0..63]])
Example
2Points may be defined with a given color:
>> point(0, 1, PI, Color = [1/2, 0, PI - 2*sqrt(2)])
point(0, 1, 3.141592654, Color = [0.5, 0.0, 0.3131655288])
The domain RGB contains many pre-defined
colors:
>> point(1.0, 0.0, 1.0, Color = RGB::Red)
point(1.0, 0.0, 1.0, Color = [1.0, 0.0, 0.0])
Example
3Symbolic coordinates or colors are not accepted:
>> point(x, y, z)
Error: Illegal argument [point]
>> point(1, 2, Color = [r, g, b])
Error: Illegal color specification [point]
However, one can create lists of points using symbolic loop variables:
>> mypoints := [point(i/40, exp(-i/40),
Color = [1 - 1/i, i/(1 + i), exp(-i/40)])
$ i = 1..40]:
plot2d(PointWidth = 30, [Mode = List, mypoints])
>> delete mypoints:
PI, exp(-sqrt(2)) etc. are
now accepted and converted to floats automatically.