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 into an 'Angle' type. By default assumes degrees.
Calculates the average of angles
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.
Convert from a unit vector to an angle, by default 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
Given two radian (0..2PI) angles, it returns the sweep angles between them that is either minimised or maximised.
Returns true if check is between start and end angles, using 0...2PI range.
Angle from x-axis to point (ie. Math.atan2)
Normalise a radian angle to 0..2*PI range
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 some angle representation to a simple numeric radian angle.
Compute unit vector of an angle. The unit vector is essentially the direction of an angle.
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.
Keeps track of keyed values of type V (eg Point). It stores occurences in type T, which
must extend from TrackerBase<V>, eg PointTracker.
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
Expresses a line as two angles and offset from a common origin.
A polar ray allows you to express a line in polar coordinates rather than two x,y points.
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.