Skip to main content

Crate fey_math

Crate fey_math 

Source
Expand description

Vectors, matrices, directions, and geometry.

Modules§

macros

Macros§

impl_affine
impl_approx
Implement approx traits on a type.
impl_bytemuck
impl_casts
Impl Castable on a generic type.
impl_interp
impl_neg
impl_op
impl_op_scalar
impl_serde
impl_tuple_arr
Impl from/to tuples and arrays for a simple struct.

Structs§

Affine2
A 2D affine matrix (translation, rotation, scaling and shear).
Affine3
A 3D affine matrix (translation, rotation, and scaling).
Circle
A circle, represented by a center point and radius.
Degrees
An angle represented in degrees.
Line
A line segment connecting two points.
Mat2
A 2x2 column major matrix.
Mat3
A 3x3 column major matrix.
Mat4
A 4x4 column major matrix.
Polygon
A convex polygon.
Projection
Represents the projection of a 2D shape on an axis.
Quad
A quad, represented by 4 points.
Radians
An angle represented in radians.
Ray
A ray with an origin and direction.
RayHit
A raycast hit on the surface of a shape.
Rect
A 2D axis-aligned rectangle.
Rotations
An angle represented in rotations.
Transform
Triangle
A triangle, represented by 3 points.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
Vec4
A 4-dimensional vector.

Enums§

Cardinal
A cardinal (4-way) direction.
CircleOut
DynShape
A circle, triangle, rect, quad, or polygon.
Octal
An octal (8-way) direction.
RectOut

Traits§

Angle
A type that represents an angle in 2D space.
Approach
A type that can approach a target.
Direction
A type that represents a direction in 2D space.
Float
A primitive floating point number type.
Interp
A type that can be interpolated.
Num
A primitive number type.
Numeric
A numeric type that can be casted.
Polygonal
A type that represents a convex 2D polygonal shape.
Shape
A type that represents a convex 2D shape.
Signed
A signed primitive number type.
SmoothInterp
A type that can smooth damp towards a target.

Functions§

affine2
Create an Affine2.
affine3
Create an Affine3.
circle
Create a Circle.
degs
Create a Degrees.
line
Create a Line.
mat2
Create a Mat2.
mat3
Create a Mat3.
mat4
Create a Mat4.
projection
Create a new projection.
quad
Create a Quad.
rads
Create a Radians.
ray
Create a Ray.
rect
Create a Rect.
rots
Create a Rotations.
triangle
Create a Triangle.
vec2
Create a Vec2.
vec3
Create a Vec3.
vec4
Create a Vec4.

Type Aliases§

Affine2F
Affine3F
CircleF
CircleI
DegreesF
DynShapeF
LineF
LineI
LineU
Mat2F
Mat3F
Mat4F
PolygonF
PolygonI
ProjectionF
QuadF
QuadI
RadiansF
RayF
RayHitF
RectF
RectI
RectU
RotationsF
TriangleF
TriangleI
Vec2F
Vec2I
Vec2U
Vec3F
Vec3I
Vec3U
Vec4F
Vec4I
Vec4U