ixfx
    Preparing search index...

    Module @ixfx/geometry - v0.46.0

    Namespaces

    Arcs

    Arcs are a angle-limited circle. Essentially describing a wedge.

    Beziers
    Circles

    A circle is defined as having a radius

    Compound
    CurveSimplification
    Ellipses
    Grids
    Layouts
    Lines
    Paths
    Points
    Polar

    Work with Polar coordinates. A Polar.Coord is just { angleRadians:number, distance: number }.

    QuadTree

    Quad tree is a datastructure for efficiently determining whether a point/shape is at a location

    Rects
    Shapes

    Generate a few basic geometric shapes Overview:

    SurfacePoints

    Functions for producing points within a shape. Useful for creating patterns.

    Triangles

    Triangle processing.

    Vectors

    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.

    Waypoints

    Functions

    angleConvert

    Converts an angle to another representation. Input value is assumed degrees unless it's an Angle type of has the unit.

    angleParse

    Parses CSS-style angle strings. By default assumes degrees.

    degreeArc

    Computes the angle arc between a start and end angle, given in degrees. It properly accounts for the wrap-around values.

    degreesSum

    Sum angles together, accounting for the 'wrap around'.

    degreeToGradian
    degreeToRadian

    Convert angle in degrees to angle in radians.

    degreeToTurn
    gradianToDegree

    Returns the gradian value converted to degrees. By default it wraps, so any value 360 or greater wraps around.

    gradianToRadian
    radianArc

    Computes the angle arc between a start and end angle, given in radians. It properly accounts for the wrap-around values.

    radianInvert

    Inverts the angle so it points in the opposite direction of a unit circle

    radiansFromAxisX

    Angle from x-axis to point (ie. Math.atan2)

    radiansSum

    Sum angles together, accounting for the 'wrap around'.

    radianToDegree

    Convert angle in radians to angle in degrees

    radianToGradian
    radianToTurn
    scaler

    Returns a set of scaler functions, to convert to and from ranges.

    turnToDegree

    Converts 'turns' to degrees. By defaults wraps the value, so turn value of 1 or 2 equal 0deg instead of 360 or 720deg.

    turnToRadian

    Classes

    PointsTracker

    A TrackedValueMap for points. Uses PointTracker to track added values.

    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.

    Type Aliases

    Angle
    Arc

    Arc, defined by radius, start and end point in radians and direction

    ArcInterpolate

    Function which can interpolate along an Arc or ArcPositioned.

    ArcPositioned

    An Arc that also has a center position, given in x, y

    ArcSvgOpts
    ArcToSvg

    Function to convert an arc to SVG segments

    BarycentricCoord
    Circle

    A circle

    CirclePositioned

    A Circle with position

    CircleRandomPointOpts
    CircleToSvg
    CompoundPath
    ContainsResult
    Coord

    Polar coordinate, made up of a distance and angle in radians. Most computations involving PolarCoord require an origin as well.

    CubicBezier
    CubicBezierPath
    Dimensions
    Grid
    GridArray1d
    GridBoundsLogic

    Bounds logic

    • Unbounded: attempts to read beyond limits
    • Undefined: returns undefined when reading beyond limits
    • Stop: returns cell value at edge of limits
    • Wrap: Wrap-around cell positions
    GridCardinalDirection
    GridCardinalDirectionOptional
    GridCell
    GridCellAccessor

    A function that returns a value (or undefined) based on a cell

    GridCellAndValue
    GridCellSetter

    A function that sets the value of a cell.

    GridCreateVisitor
    GridIdentifyNeighbours

    Identify neighbours logic. For a given grid and origin, return a list of neighbours

    GridNeighbour
    GridNeighbourMaybe
    GridNeighbours
    GridNeighbourSelectionLogic

    Logic to select the next cell based on a list of neighbours

    GridNeighbourSelector

    Neighbour selector logic. For a given set of neighbours pick one to visit next.

    GridReadable

    Shape of a grid and a function to read values from it, based on cell location.

    GridVisitorOpts
    GridVisual
    GridWritable
    Line

    A line, which consists of an a and b Point.

    LinePath
    Path
    Point

    A point, consisting of x, y and maybe z fields.

    Point3d
    PointCalculableShape
    PointRelation
    PointRelationResult
    PointTrack

    Information about seen points

    PointTrackerResults

    Results of point tracking

    PolarRay

    A polar ray is allows you to express a line in polar coordinates

    PolarRayWithOrigin
    PolarToCartesian

    Converts to Cartesian coordiantes

    PolyLine

    A PolyLine, consisting of more than one line.

    QuadraticBezier
    QuadraticBezierPath
    Rect
    Rect3d
    Rect3dPositioned
    RectArray

    Rectangle as array: [width, height]

    RectPositioned
    RectPositionedArray

    Positioned rectangle as array: [x, y, width, height]

    ScaleBy
    Scaler

    A scale function that takes an input value to scale. Input can be in the form of { x, y } or two number parameters.

    ScalerCombined

    A scaler than can convert to a from an output range

    ShapePositioned
    Sphere
    Triangle
    WithBeziers

    Variables

    Placeholder

    Placeholder point: { x: NaN, y: NaN } Use isPlaceholder to check if a point is a placeholder. Use Placeholder3d get a point with z property.

    Placeholder3d

    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.