Closed amit2103 closed 9 years ago
I would say when we need this feature we should implement it. We're not programming a standard library, so things should be added when needed.
@TheJJ Correct...This should be so...I really assumed that magnitude and inverse will be needed at some point. It might not be the case.
If we should need it at some point, we can reopen this issue. Otherwise we should focus on things we actually need now :smile:
Yep :+1:
We already have norm
which probably does what you described by magnitude. An additive inverse can be computed by multiplying with -1
.
By magnitude I meant that suppose there is a vector (6,8) its magnitude will be then √( 36 + 64 ). Inverse yes can be obtained by multiplying by -1...but I assumed that its better for the Vector to give its inverse than letting the user compute it.
The norm
function in https://github.com/SFTtech/openage/blob/57d766332ad9420321d3855379cced7564c22263/libopenage/util/vector.h#L130 indeed computes the length.
Indeed it does. Out of curiosity though , shouldn't it be done more or less faster by using the method I described, than using the dot product here?
While there is no limit to probably the operations that we need, I think these two should be implemented in the implementation for openage. If its deemed necessary I can code this. However if for our current implementation this is not deemed necessary, feel free to close this issue.