class String

Public Instance Methods

to_q() click to toggle source

Returns a quaternion which denotes the string form. The parser ignores leading whitespaces and trailing garbage. Any digit sequences can be separated by an underscore. Returns zero for null or garbage string.

@return [Quaternion]

@example

"1-2i-3/4j+0.56k".to_q #=> (1-2i-(3/4)*j+0.56k)
"foobarbaz".to_q       #=> (0+0i+0j+0k)
# File lib/quaternion_c2/to_type.rb, line 206
def to_q
        Quaternion.send(:parse, self, false).to_q
end