## `point` -- generate a graphical point primitive

#### Introduction

`point(`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]>)`

#### Parameters

`x, y, z` | - | real numbers

#### Options

`Color =` [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.

#### Returns

an object of type `DOM_POINT`.

#### Related Functions

`plot`, `plot::Point`, `plot2d`, `plot3d`, `plotfunc2d`, `plotfunc3d`, `polygon`, `RGB`

#### Details

- `point` 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.

- The `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]`

- The color values `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.
- The domain `RGB` contains many pre-defined colors.

#### Operands

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 1

`point` 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 2

Points 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 3

Symbolic 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:

#### Changes

- Exact numerical expressions such as `PI`, `exp(-sqrt(2))` etc. are now accepted and converted to floats automatically.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000