Anonymous user
Quaternion type: Difference between revisions
→{{header|Ruby}}: Fixed a bug with Ruby's multiplication.
(→E: new example) |
(→{{header|Ruby}}: Fixed a bug with Ruby's multiplication.) |
||
Line 2,203:
Quaternion.new(
@a * q.a - @b * q.b - @c * q.c - @d * q.d,
@a * q.b
@a * q.c - @b * q.d
@a * q.d
elsif q.is_a? Numeric
Quaternion.new(@a * q, @b * q, @c * q, @d * q)
|