Previous Page Next Page Contents

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

Option: Color = [r, g, b]

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




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000