Point
Point[p_List | _Offload]
is a graphics and geometry primitive that represents a point at p
,
Point[{p1_List, p2_List, ...}]
represents collection of points
Graphics[Point[Table[{t, Sin[t]}, {t, 0, 2 \[Pi], 2 \[Pi]/10}]]]
Graphics[
Table[{Hue[RandomReal[],1,0.5], PointSize[RandomReal[{0, 0.1}]],
Point[RandomReal[1, {2}]]}, {200}]]
Parameters
RGBColor
specifies colors of a points
Opacity
specifies opacity
PointSize
absolute size of a point
Methods
EventHandler
One can listen to a several events produced by this primitive using EventHandler
EventHandler[t_Point, {event_ -> handler_, ...}]
where event
can be
"mousemove"
detects and sends coordinates of a mouse, when it is over this element"drag"
makes primitive draggable and emits coordinates"zoom"
detects zoom / mouse-wheel"click"
detects mouse clicks
tip
See more in Mouse and keyboard
Indexed geometry
Using it inside GraphicsComplex allows to specify only the indexes of vertices as arguments similar to faces like in Indexed geometry
Dynamics
Point primitive supports dynamic updates even if the number of points is not constant.
There is a famous example of 1000 particles "dancing" with each other
cell 1
n = 1000;
r := RandomInteger[{1, n}];
f := (#/(.01 + Sqrt[#.#])) & /@ (x[[#]] - x) &;
s := With[{r1 = r}, p[[r1]] = r; q[[r1]] = r];
x = RandomReal[{-1, 1}, {n, 2}];
{p, q} = RandomInteger[{1, n}, {2, n}];
cell 2
EventHandler["frame", Function[Null,
(* all calculations *)
x = 0.995 x + 0.02 f[p] - 0.01 f[q];
If[r < 100, s];
]];
cell 3
Graphics[{
PointSize[0.007], Point[x // Offload],
AnimationFrameListener[x // Offload, "Event"->"frame"]
}, PlotRange -> {{-2,2}, {-2,2}}, "TransitionType"->"Linear", "TransitionDuration"->1]