A circle is defined as having a radius
Work with Polar coordinates.
A Polar.Coord is just { angleRadians:number, distance: number }
.
Quad tree is a datastructure for efficiently determining whether a point/shape is at a location
Functions for producing points within a shape. Useful for creating patterns.
Triangle processing.
Helper functions for working with vectors, which can either be a Points.Point or Polar Polar.Coord. While most of the functionality is provided in either of those modules, the Vector module lets you cleanly interoperate between these two coordinates.
Converts an angle to another representation. Input value is assumed degrees unless it's an Angle type of has the unit.
Parses CSS-style angle strings. By default assumes degrees.
Computes the angle arc between a start and end angle, given in degrees. It properly accounts for the wrap-around values.
Sum angles together, accounting for the 'wrap around'.
Convert angle in degrees to angle in radians.
Returns the gradian value converted to degrees. By default it wraps, so any value 360 or greater wraps around.
Computes the angle arc between a start and end angle, given in radians. It properly accounts for the wrap-around values.
Inverts the angle so it points in the opposite direction of a unit circle
Angle from x-axis to point (ie. Math.atan2
)
Sum angles together, accounting for the 'wrap around'.
Convert angle in radians to angle in degrees
Returns a set of scaler functions, to convert to and from ranges.
Converts 'turns' to degrees. By defaults wraps the value, so turn value of 1 or 2 equal 0deg instead of 360 or 720deg.
A TrackedValueMap for points. Uses PointTracker to track added values.
A tracked point. Mutable. Useful for monitoring how it changes over time. Eg. when a pointerdown event happens, to record the start position and then track the pointer as it moves until pointerup.
Arc, defined by radius, start and end point in radians and direction
Function which can interpolate along an Arc or ArcPositioned.
An Arc that also has a center position, given in x, y
Function to convert an arc to SVG segments
A circle
A Circle with position
Polar coordinate, made up of a distance and angle in radians.
Most computations involving PolarCoord require an origin
as well.
Bounds logic
A function that returns a value (or undefined) based on a cell
A function that sets the value of a cell.
Identify neighbours logic. For a given grid
and origin
, return a list of neighbours
Logic to select the next cell based on a list of neighbours
Neighbour selector logic. For a given set of neighbours
pick one to visit next.
Shape of a grid and a function to read values from it, based on cell location.
A line, which consists of an a
and b
Point.
A point, consisting of x, y and maybe z fields.
Information about seen points
Results of point tracking
A polar ray is allows you to express a line in polar coordinates
Converts to Cartesian coordiantes
A PolyLine, consisting of more than one line.
Rectangle as array: [width, height]
Positioned rectangle as array: [x, y, width, height]
A scale function that takes an input value to scale.
Input can be in the form of { x, y }
or two number parameters.
A scaler than can convert to a from an output range
Placeholder point: { x: NaN, y: NaN }
Use isPlaceholder
to check if a point is a placeholder.
Use Placeholder3d
get a point with z
property.
Placeholder point: {x: NaN, y:NaN, z:NaN }
Use isPlaceholder
to check if a point is a placeholder.
Use Placeholder
to get a point without z
property.
Arcs are a angle-limited circle. Essentially describing a wedge.