Class Fox::FXHVec
In: rdoc-sources/FXVec4.rb
lib/fox12/core.rb
Parent: Object

FXHVec is a 3-D homogenous vector.

Methods

*   +   -   -@   /   ==   []   []=   cross   dot   hi   len   lo   new   new   new   new   normalize   normalize!   to_a   to_s  

Public Class methods

Returns a new, uninitialized FXHVec instance.

Initialize with color

Returns a new FXHVec instance with initial components (x, y, z and w).

Returns a new FXHVec instance with contents initialized from other, where other is either an FXVec or FXHVec instance.

Public Instance methods

Returns the product of this vector and the scalar x.

Returns the sum of this vector and another vector

Returns the difference, this vector minus another vector

Returns the negation of this

Returns the quotient, this vector divided by the scalar x.

Returns true if this vector is equal to other.

Returns the ith element of this vector.

Set the ith element of this vector to x.

Returns the cross product of this vector and other.

Returns the dot product of this vector and other.

Returns a new FXHVec, each of whose components is equal to the greater of this vector’s and other’s components, i.e.

  self.lo(other) === FXHVec.new( [self[0], other[0]].max,
                                 [self[1], other[1]].max,
                                 [self[2], other[2]].max,
                                 [self[3], other[3]].max )

Returns the length of this vector

Returns a new FXHVec, each of whose components is equal to the smaller of this vector’s and other’s components, i.e.

  self.lo(other) === FXHVec.new( [self[0], other[0]].min,
                                 [self[1], other[1]].min,
                                 [self[2], other[2]].min,
                                 [self[3], other[3]].min )

Returns the normalized version of this vector.

Convert to an array

Returns a stringified version of this vector

[Validate]