1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// This file is part of "linbra"
// Under the MIT License
// Copyright (c) 2023 Antonin Hérault
//! Easily do linear algebra in game development, graphics and other sort of
//! calculations using vectors and matrices.
//!
//! Every implementation, function or item is documented mathematically and for
//! programming. Browses the items and their functions to learn how to use them!
//!
//! ## Overview
//! - Objects:
//!
//! | Mathematics | Linbra | Related types |
//! | --- | --- | --- |
//! | $$ \begin{pmatrix} x_{1,1} & x_{1,2} & \dots & x_{1,C} \\\ x_{2,1} & x_{2,2} & \dots & x_{2,C} \\\ \vdots & \vdots & \ddots & \vdots \\\ x_{R,1} & x_{R,2} & \dots & x_{R,C} \\\ \end{pmatrix} $$ | [`Matrix<T, C, R>`](matrix::Matrix) | <ul><li>[`Matrix2<T>`](matrix::Matrix2)</li> <li>[`Matrix3<T>`](matrix::Matrix3)</li> <li>[`Matrix4<T>`](matrix::Matrix4)</li></ul> |
//! | | | |
//! | $$ \begin{pmatrix} a_{1} \\\ a_{2} \\\ \vdots \\\ a_{n} \\\ \end{pmatrix} $$ | [`Vector<T, N>`](vector::Vector) | <ul><li>[`Vector2<T>`](vector::Vector2)</li> <li>[`Vector3<T>`](vector::Vector3)</li> <li>[`Vector4<T>`](vector::Vector4)</li></ul> |
//!
//! - Tools:
//!
//! | Mathematics | Related traits | and their functions |
//! | --- | --- | --- |
//! | $$ \begin{pmatrix} x \\\ y \\\ \end{pmatrix} or \begin{pmatrix} x \\\ y \\\ z \\\ \end{pmatrix} $$ | <ul><li>[`Point2<T>`](points::Point2)</li><li>[`Point3<T>`](points::Point3)</li></ul> | <ul><li>[`::x()`](points::Point2::x)</li><li>[`::y()`](points::Point2::y)</li><li>[`::z()`](points::Point3::z)</li></ul> |
//! | | | |
//! | $$ \begin{pmatrix} w \\\ h \\\ \end{pmatrix} or \begin{pmatrix} w \\\ h \\\ d \\\ \end{pmatrix} $$ | <ul><li>[`Size2<T>`](sizes::Size2)</li><li>[`Size3<T>`](sizes::Size3)</li></ul> | <ul><li>[`::w()`](sizes::Size2::w)</li><li>[`::h()`](sizes::Size2::h)</li><li>[`::d()`](sizes::Size3::d)</li></ul> |
//! | | | |
//! | $$ \begin{pmatrix} r \\\ g \\\ b \\\ \end{pmatrix} or \begin{pmatrix} r \\\ g \\\ b \\\ a \\\ \end{pmatrix} $$ | <ul><li>[`RGB<T>`](colours::RGB)</li><li>[`RGBA<T>`](colours::RGBA)</li></ul> | <ul><li>[`::r()`](colours::RGB::r)</li><li>[`::g()`](colours::RGB::g)</li><li>[`::b()`](colours::RGB::b)</li><li>[`::a()`](colours::RGBA::a)</li></ul> |
use ops;
/// Implements a function to get the zero-value of the type.
///
/// This trait is implemented for all the number-primitive types.
/// Common properties to all the number-primitive types.
///
/// No function provided.
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;
impl_primitive_numbers!;