Class: Fox::FXVec2d
- Inherits:
-
Object
- Object
- Fox::FXVec2d
- Defined in:
- rdoc-sources/FXVec2d.rb,
lib/fox16/core.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#*(n) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise multiplication of this vector's elements by the scalar n.
-
#+(other) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise addition of the other FXVec2d instance with this one.
-
#-(other) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise subtraction of the other FXVec2d instance from this one.
-
#-@ ⇒ Object
Returns a new FXVec2d instance which is the negation of this one.
-
#/(n) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise division of this vector's elements by the scalar n.
-
#==(other) ⇒ Object
Return
true
if this vector is equal to other. -
#[](index) ⇒ Object
Returns the element at index, where index is 0 or 1.
-
#[]=(index, value) ⇒ Object
Set the element at index to value and return value.
-
#clamp(lo, hi) ⇒ Object
Clamp the values of this vector between limits lo and hi.
-
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
-
#hi(other) ⇒ Object
Return a new FXVec2d instance which is the greater of this vector and other.
-
#initialize(xx = 0.0, yy = 0.0) ⇒ FXVec2d
constructor
Return an initialized FXVec2d instance.
- #inspect ⇒ Object
-
#length ⇒ Object
Return the length (magnitude) of this vector.
-
#length2 ⇒ Object
Return the square of the length of this vector.
-
#lo(other) ⇒ Object
Return a new FXVec2d instance which is the lesser of this vector and other.
-
#normalize ⇒ Object
Return a new FXVec2d instance which is a normalized version of this one.
-
#to_a ⇒ Object
Convert to array.
-
#to_s ⇒ Object
Convert to string.
Constructor Details
#initialize(xx = 0.0, yy = 0.0) ⇒ FXVec2d
Return an initialized FXVec2d instance.
10 |
# File 'rdoc-sources/FXVec2d.rb', line 10 def initialize(xx=0.0, yy=0.0); end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
4 5 6 |
# File 'rdoc-sources/FXVec2d.rb', line 4 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'rdoc-sources/FXVec2d.rb', line 5 def y @y end |
Instance Method Details
#*(n) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise multiplication of this vector's elements by the scalar n.
46 |
# File 'rdoc-sources/FXVec2d.rb', line 46 def *(n); end |
#+(other) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise addition of the other FXVec2d instance with this one.
32 |
# File 'rdoc-sources/FXVec2d.rb', line 32 def +(other); end |
#-(other) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise subtraction of the other FXVec2d instance from this one.
39 |
# File 'rdoc-sources/FXVec2d.rb', line 39 def -(other); end |
#-@ ⇒ Object
Returns a new FXVec2d instance which is the negation of this one.
25 |
# File 'rdoc-sources/FXVec2d.rb', line 25 def -@(); end |
#/(n) ⇒ Object
Returns a new FXVec2d instance obtained by memberwise division of this vector's elements by the scalar n. Raises ZeroDivisionError if n is identically zero.
54 |
# File 'rdoc-sources/FXVec2d.rb', line 54 def /(n); end |
#==(other) ⇒ Object
Return true
if this vector is equal to other.
62 |
# File 'rdoc-sources/FXVec2d.rb', line 62 def ==(other); end |
#[](index) ⇒ Object
Returns the element at index, where index is 0 or 1. Raises IndexError if index is out of range.
16 |
# File 'rdoc-sources/FXVec2d.rb', line 16 def [](index); end |
#[]=(index, value) ⇒ Object
Set the element at index to value and return value. Raises IndexError if index is out of range.
22 |
# File 'rdoc-sources/FXVec2d.rb', line 22 def []=(index, value); end |
#clamp(lo, hi) ⇒ Object
Clamp the values of this vector between limits lo and hi.
75 |
# File 'rdoc-sources/FXVec2d.rb', line 75 def clamp(lo, hi); end |
#dot(other) ⇒ Object
Returns the dot (scalar) product of this vector and other.
59 |
# File 'rdoc-sources/FXVec2d.rb', line 59 def dot(other); end |
#hi(other) ⇒ Object
Return a new FXVec2d instance which is the greater of this vector and other.
93 |
# File 'rdoc-sources/FXVec2d.rb', line 93 def hi(other); end |
#inspect ⇒ Object
241 |
# File 'lib/fox16/core.rb', line 241 def inspect; to_a.inspect; end |
#length ⇒ Object
Return the length (magnitude) of this vector.
72 |
# File 'rdoc-sources/FXVec2d.rb', line 72 def length; end |
#length2 ⇒ Object
Return the square of the length of this vector.
67 |
# File 'rdoc-sources/FXVec2d.rb', line 67 def length2; end |
#lo(other) ⇒ Object
Return a new FXVec2d instance which is the lesser of this vector and other.
87 |
# File 'rdoc-sources/FXVec2d.rb', line 87 def lo(other); end |
#normalize ⇒ Object
Return a new FXVec2d instance which is a normalized version of this one.
81 |
# File 'rdoc-sources/FXVec2d.rb', line 81 def normalize; end |
#to_a ⇒ Object
Convert to array
232 233 234 |
# File 'lib/fox16/core.rb', line 232 def to_a [x, y] end |
#to_s ⇒ Object
Convert to string
237 238 239 |
# File 'lib/fox16/core.rb', line 237 def to_s to_a.to_s end |