quaternion.rb

Copyright © 2002 K. Kodama

  Ruby License

  This module is free software. You may use, modify, and/or redistribute this
  software under the same terms as Ruby.

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.

Author(s)

  • K. Kodama

Developer Notes

  TODO The following documentation should occur before the methods
       they describe.
Required Files
Methods
Public Instance methods
Quaternion(a=0, b=0,c=0, d=0)
# File lib/facets/more/quaternion.rb, line 224
def Quaternion(a=0, b=0,c=0, d=0)
  if a.kind_of?(Quaternion);
    a;
  elsif a.kind_of?(Complex) and b.kind_of?(Complex);
    Quaternion.new(a.real, a.image, b.real, b.image)
  elsif a.kind_of?(Complex);
    Quaternion.new(a.real, a.image)
  else
    Quaternion.new(a,b,c,d);
  end
end