Impl Div for Vector, Add, Mul, Div for Size, etc #1724
ArtHome12
started this conversation in
Show and tell
Replies: 3 comments 3 replies
-
Perhaps it is worth considering the use of a geometric library, for example, euclid. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Point is tied to type f32 due to f32.hypot(). Therefore, I propose to add arithmetic only for Size and Vector, into which to convert Point if necessary. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I found that the mathematical operations on Size, Point, Vector are only partially implemented and prepared changes to support +, -, *, /, %, as well as +=, -=, *=, /=, %=. The second operand can be either a scalar or Self.
If there are no comments, I will send a request. Now I'm still testing the changes on a real project.
Below is sample code and tests
Beta Was this translation helpful? Give feedback.
All reactions