dart_math library

Compatibility export for applications using the former dart_math package name.

Classes

Camera3D
A 3D camera controlled via spherical coordinates around a target point.
Conic3D
Implicit conic equation in the local plane coordinates: quadraticX*x² + quadraticXY*x*y + quadraticY*y² + linearX*x + linearY*y + constant = 0.
ConstructionState
Tracks the state of an ongoing construction.
ConstructionStep
Describes the next user action in a tool workflow.
ConstructionWorkflow
The input sequence associated with a construction or object-action tool.
CoordinatePoint
A single coordinate point (x, y).
Expression3D
Represents a 3D math expression — a surface, parametric curve, or parametric surface.
FormulaEntry
A single formula entry with its parsed expression, color, and parameters.
GraphPainter
A CustomPainter that renders a mathematical graph with:
Math3DToolbar
The 3D toolbox keeps categories in a horizontal strip and scrolls long tool rows horizontally on touch, trackpad, and mouse wheel input.
MathCanvas
A pure-Flutter canvas for plotting mathematical functions.
MathCanvas3D
A 3D rendering canvas using Flutter's CustomPainter.
MathCanvas3DPainter
CustomPainter that renders a 3D scene onto a 2D Canvas.
MathCanvas3DState
The state class for MathCanvas3D, exposing methods for parent control.
MathCanvasState
The state class for MathCanvas, exposing methods that can be called from the parent widget to control the canvas.
MathCanvasWebView
A WebView-based canvas that renders math functions using JSXGraph.
MathCanvasWebViewState
The state class for MathCanvasWebView, exposing methods that can be called from the parent widget to control the canvas.
MathDrawingController
Commands and lifecycle events for the complete math workspace.
MathDrawingPage
A complete math workspace with formula editing, graphing, and 3D geometry.
MathDrawingSnapshot
Immutable state captured from the complete workspace for host save/restore.
MathExpression
Represents a single math expression with its various forms.
MathFormulaField
A formula editor with source and mathematical input modes.
MathFormulaFieldState
MathInputTemplate
Structured inputs for the finite numeric vocabulary of the 2D evaluator. Keeping these shared prevents a graph function from losing its keyboard path.
MathKeyboard
All editing is structural: templates use MathLive's selection/placeholder arguments, and navigation operates on the rendered document, not text.
MathNumericKeyboard
Numeric-only text input for parameter expressions. The keys expose no variables or named constants; function names are inserted only by the square-root and absolute-value templates.
MathParameter
A shared parameter value and the slider grid used to adjust it.
MathParameterControls
Compact controls intended to share the formula list's scrolling viewport.
MathWorkspaceCapabilities
Runtime platform capabilities relevant to workspace integration.
MathWorkspaceInteractionPolicy
Selects which pointer families can manipulate package-owned canvases.
MathWorkspaceLabels
Labels for the workspace chrome that commonly needs host localization. Unspecified values retain the package's Chinese defaults.
MathWorkspaceOptions
Selects which built-in views and workspace regions MathDrawingPage shows.
MathWorkspacePersistence
Controls persistence of workspace input preferences.
MathWorkspacePresentation
Presentation-level controls for hosts embedding MathDrawingPage.
MathWorkspaceRegionActions
Page-owned values and actions available to custom workspace regions.
Object3D
A 3D object in the scene.
Point3D
A 3D point with x, y, z coordinates.
Projection3D
A 3D projection that maps world coordinates to screen coordinates.
Ray3D
A ray in world space, used by the construction tools to turn a screen gesture into a point on a working plane.
Scene3D
A 3D scene containing objects, a camera, and projection settings.
ScreenPoint
A projected 2D screen point with depth (for z-sorting).
SurfaceMesh
A triangle mesh representing a surface.
ToolInfo
Vector3D
A 3D vector with x, y, z components.
Viewport
Viewport bounds for the 2D canvas.

Enums

ArrowDirection
Arrow direction for axis tips.
ConstructionAction
Result of a construction action — what the system should do next.
ConstructionTool
Construction and view tools offered by the 3D editor.
Expression3DType
The type of a 3D expression.
Line3DKind
MathExpressionType
The type of a math expression.
MathWorkspaceControlPlacement
Anchor for the built-in 2D canvas actions.
MathWorkspaceDensity
Density choices for the package-owned workspace layout.
Object3DType
Types of 3D objects that can be rendered.
PointDragMode
ProjectionType
Type of 3D projection.
ToolBehavior
ToolGroup
Categories in the 3D toolbox. Quick access tools can also appear in their detailed category.
ViewMode
View mode for the math drawing page.
WebViewMessageType
Message types sent from WebView to Flutter via the JavaScript channel.

Constants

formulaPalette → const List<Color>
A palette of distinct colors for auto-assigning to formulas.
mathBinaryInputs → const List<MathInputTemplate>
mathConstantInputs → const List<MathInputTemplate>
mathExponentialInputs → const List<MathInputTemplate>
Explicit bases avoid confusing the evaluator's legacy natural log(x) with the common school notation for a base-ten logarithm.
mathGreekLowerNames → const List<String>
mathGreekNames → const List<String>
mathGreekUpperNames → const List<String>
mathGreekVariantNames → const List<String>
mathUnaryInputs → const List<MathInputTemplate>
maxSolidEdgeWidth → const double

Functions

clipLineToView(Object3D object, Camera3D camera, Projection3D projection) → List<Point3D>
Clip a segment, ray or infinite line against the camera's viewing volume. The returned world endpoints are shared by rendering and pointer snapping.
formatMathParameterNumber(double value) → String
Keep labels readable when arithmetic leaves insignificant decimal digits.
identityMatrix4() → List<double>
Identity 4x4 matrix (column-major).
intersectRayPlane(Ray3D ray, {required Point3D point, required Vector3D normal, bool allowBehind = false}) → Point3D?
Intersect a world-space ray with an infinite plane.
multiplyMatrix4(List<double> a, List<double> b) → List<double>
Multiply two 4x4 column-major matrices: A * B.
nextFormulaColor(Set<Color> usedColors) → Color
Assign the next auto-color from the palette, skipping usedColors. Cycles through the palette if all colors are used.
scaleMatrix4(double sx, double sy, double sz) → List<double>
Scale 4x4 matrix (column-major).
solidEdgeContrastColor(Color fillColor) → Color
translateMatrix4(double tx, double ty, double tz) → List<double>
Translation 4x4 matrix (column-major).
worldToScreen(Point3D worldPoint, Camera3D camera, Projection3D projection) → ScreenPoint
Transform a world 3D point through camera view and projection to screen.

Typedefs

MathWorkspaceAppBarBuilder = PreferredSizeWidget Function(BuildContext context, PreferredSizeWidget defaultAppBar)
Builds an app bar from the package-provided default app bar.
MathWorkspaceRegionBuilder = Widget Function(BuildContext context, Widget defaultContent, MathWorkspaceRegionActions actions)
Builds a workspace region from its default package-provided content.
NumericMathInsert = void Function(String text, {int? cursorFromEnd})
On3DObjectCreated = void Function(Object3D object)
On3DReady = void Function()
Callback types for canvas → parent communication.
On3DSceneChange = void Function()
On3DSelectionChange = void Function(Object3D? object)
On3DToolInstruction = void Function(String instruction)
On3DViewportChange = void Function()
OnCoordinateUpdate = void Function(List<Map<String, double>> points)
Callback types for canvas → parent communication.
OnError = void Function(String message)
OnReady = void Function()
OnViewportChange = void Function(double xMin, double yMin, double xMax, double yMax)