Skip to main content

Module vector2

Module vector2 

Source
Expand description

A 2-dimensional Euclidean vector backed by f64.

Port of core/Vector2.hpp. Unlike the C++ original — where Point2 is a bare typedef for Vector2 and every coordinate space collapses into the same type — the semantic distinction between coordinate spaces is layered on top via the zero-cost newtypes in crate::math::typed. Vector2 itself remains the plain workhorse used inside the hot geometry/distance loops.

Structs§

Vector2
A 2D vector / point in a single, untyped coordinate space.

Functions§

cross
2D cross product (returns the scalar z-component).
dot
Dot product.

Type Aliases§

Point2
Semantic alias: a Vector2 used as a position rather than a direction.