Library

PenPlots.unitvecConstant

The unit vector (0, 1).

Useful for creating n-gons, e.g.:

using PenPlots

expect = [
    [-1, 0],
    [0, -1],
    [1, 0],
    [0, 1],
]

isapprox(expect, [frac_rotation(i/4) * unitvec for i in 1:4])

# output

true
source
PenPlots.LayerType

Represents a layer of a plot.

A "layer" is a full pass of one pen. A layer has an associated color which is used for previewing the plot in the SVG export, but the color is not used by the plotting software.

source
PenPlots.PenPlotType

A plot, consisting of one or more layers.

Constructed with:

PenPlot(layers...)

Construct a pen plot consisting of the given layers.

Layers may be:

  • Layer objects
  • MultiPath objects
  • Pair{String, MultiPath} objects, where the string becomes the name of the layer.
source
PenPlots.frac_rotationMethod
frac_rotation(frac)

Create a rotation matrix for the angle given as a fraction, i.e. 1.0 represents a full rotation and 0.5 a half rotation.

source
PenPlots.perlin_noiseMethod
perlin_noise(control_points, point)

Compute the noise gradient for the given point, given a grid of control points.

source
PenPlots.point_matrixMethod
point_matrix(xs, ys)

Generate a matrix by producing Points for the cartesian product of the vectors of x and y values given. The resulting matrix will have as many columns as entries of xs, and as many rows as values of ys.

source
PenPlots.random_vector_matrixMethod
random_vector_matrix([rng,] rows, cols)

Produce a matrix with the given number of rows and columns, in which every entry is a random unit vector. If provided, the given random number generator is used to determine the vectors.

source