Evandro
Evandro
Good luck! In any case, try not to recode everything by hand. Inheritance is probably the way to go here: by creating a `UnitQuaternion` class that inherits from `Quaternion`, you...
If you're using the `norm` argument as defined in the `Quaternion` class, you don't need to redefine the `norm()` method. The idea of having a `UnitQuaternion` class, though, would be...
> I understand! My concern was that internally `_norm` would be None, therefore if someone substituted the values to numbers that didn't match norm=1 it wouldn't inform the user about...
The absolute best would be to have some sort of system that you can add constraints to variables. I suppose it would be a monumental task to implement this, though....
> I think that it is better to take a step back and consider why anyone would want any of these features. I have used the `Quaternion` class extensively during...
> Maybe that should be changed. Perhaps the `to_rotation_matrix` method could have a parameter to prevent dividing by the norm if the quaternion can be assumed to be a unit...
Also, there are other methods that call `norm` I think, not only `to_rotation_matrix`. A good thing about setting the norm argument is that it propagates this property of the quaternion...
In this case I think a `UnitQuaternion` class is a good idea: one if you're expecting a completely general quaternion, and another one if you're expecting a unit quaternion. Yes,...
I think the problem is that it would go against conventions coming from maths. When using a quaternion to represent a rotation, we use the conjugation operation that is [defined](https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation)...
Here's an example of a real application. Suppose I want to implement in my robot a little code that takes a quaternion and transforms it into Euler angles. I could...