Namespace Geometry

Functions for different shapes, paths and coordinate spaces.

A foundation module is Points for working with x, y (and maybe z). It has the top-level helper functions: degreeToRadian and radianToDegree

Basic shapes: Arcs, Circles, Ellipses, Lines, Rects, Triangles

Curves & paths: Beziers, Paths, Compound

Util:

  • Polar: Polar coordinates
  • Scaler: Simplify back and forth conversion between absolute/relative Cartesian coordinates
  • Shapes: Generates a few shapes like arrows
  • SurfacePoints: Generate points within a shape. Useful for creating patterns
  • Vectors: Vector operations working on either Cartesian or polar coordinates

Example: Importing

// If library is stored two directories up under `ixfx/`
import {Lines, Points} from '../../ixfx/dist/geometry.js';
// Import from web
import {Lines, Points} from 'https://unpkg.com/ixfx/dist/geometry.js'

References

Re-exports Circle
Re-exports CirclePositioned
Re-exports CircularPath
Re-exports CompoundPath
Re-exports Dimensions
Re-exports Line
Re-exports Path
Re-exports Point
Re-exports Point3d
Re-exports PointCalculableShape
Re-exports PolyLine
Re-exports RandomPointOpts
Re-exports Rect
Re-exports RectArray
Re-exports RectPositioned
Re-exports RectPositionedArray
Re-exports ShapePositioned
Re-exports Triangle
Re-exports WithBeziers
Re-exports area
Re-exports cardinal
Re-exports center
Re-exports clamp
Re-exports corners
Re-exports distanceFromCenter
Re-exports distanceFromExterior
Re-exports edges
Re-exports empty
Re-exports emptyPositioned
Re-exports fromCenter
Re-exports fromElement
Re-exports fromNumbers
Re-exports fromTopLeft
Re-exports getEdgeX
Re-exports getEdgeY
Re-exports getEnd
Re-exports getRectPositioned
Re-exports getRectPositionedParameter
Re-exports getStart
Re-exports guard
Re-exports guardDim
Re-exports guardPositioned
Re-exports intersectsPoint
Re-exports isEmpty
Re-exports isEqual
Re-exports isEqualSize
Re-exports isIntersecting
Re-exports isPlaceholder
Re-exports isPositioned
Re-exports isRect
Re-exports isRectPositioned
Re-exports lengths
Re-exports maxFromCorners
Re-exports multiply
Re-exports multiplyScalar
Re-exports normaliseByRect
Re-exports perimeter
Re-exports placeholder
Re-exports placeholderPositioned
Re-exports random
Re-exports randomPoint
Re-exports subtract
Re-exports sum
Re-exports toArray