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
// This file is part of "linbra"
// Under the MIT License
// Copyright (c) 2023 Antonin Hérault
//! Traits to get x, y and z values of a 2d-point or a 3d-point, and
//! constructors for these points.
use ops;
use crate;
/// Implements functions to retrieve vertical and horizontal positions of a
/// point in a 2d plan.
/// Implements the [`Point2`] trait for 2-vectors.
/// Implements the [`Point3`] trait for 3-vectors.
/// Implements a constructor for 2d-points.
///
/// ## Example
/// ```
/// use linbra::{
/// points::Point2,
/// vector::Vector2
/// };
///
/// let point = Vector2::at(10, 5);
///
/// assert_eq!(point.x(), 10);
/// assert_eq!(point.y(), 5);
/// ```
/// Implements a function to retrieve the depth of a point in a 3D plan.
/// Implements the [`Point3`] trait for 2-vectors.
/// Implements a constructor for 3d-points.
///
/// ## Example
/// ```
/// use linbra::{
/// points::{ Point2, Point3 },
/// vector::Vector3
/// };
///
/// let point = Vector3::at(10, 5, 2);
///
/// assert_eq!(point.x(), 10);
/// assert_eq!(point.y(), 5);
/// assert_eq!(point.z(), 2);
/// ```