Module math

Module math 

Source
Expand description

Mathematical structs and functions.

Structs§

CubicBezier2d
A cubic bezier curve
CubicFn
A cubic function, which is a polynomial of the form ax^3 + bx^2 + cx + d.
LineSegment2d
A line segment
LookupTable
A lookup table
QuadraticBezier2d
A quadratic bezier curve

Traits§

ParametricCurve2d
A parametric curve in 2D space.

Functions§

equidistant_points_along_curve
Finds a set of evenly spaced points along the given parametric curve.
intersect_curves
Finds intersection between two curves, if one exists.
normalize_with_derivative
Normalises a vector and computes the derivative of the normalised vector.
project_local
Projects a point onto a local coordinate system.
project_point_onto_curve
Projects a point onto a parametric curve.
rot90
Rotates a vector 90 degrees clockwise.
subdivided_points_along_curve
Approximates a curve by subdividing it until all segments are no longer than max_length units in length.
subdivided_samples_along_curve
Approximates a curve by subdividing it until all segments are no longer than max_length units in length.

Type Aliases§

Point2d
A 2D point
Vector2d
A 2D vector