Class: Fox::FXVec2f

Inherits:
Object
  • Object
show all
Defined in:
rdoc-sources/FXVec2f.rb,
lib/fox16/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xx = 0.0, yy = 0.0) ⇒ FXVec2f

Return an initialized FXVec2f instance.



10
# File 'rdoc-sources/FXVec2f.rb', line 10

def initialize(xx=0.0, yy=0.0); end

Instance Attribute Details

#xObject

Returns the value of attribute x.



4
5
6
# File 'rdoc-sources/FXVec2f.rb', line 4

def x
  @x
end

#yObject

Returns the value of attribute y.



5
6
7
# File 'rdoc-sources/FXVec2f.rb', line 5

def y
  @y
end

Instance Method Details

#*(n) ⇒ Object

Returns a new FXVec2f instance obtained by memberwise multiplication of this vector’s elements by the scalar n.



46
# File 'rdoc-sources/FXVec2f.rb', line 46

def *(n); end

#+(other) ⇒ Object

Returns a new FXVec2f instance obtained by memberwise addition of the other FXVec2f instance with this one.



32
# File 'rdoc-sources/FXVec2f.rb', line 32

def +(other); end

#-(other) ⇒ Object

Returns a new FXVec2f instance obtained by memberwise subtraction of the other FXVec2f instance from this one.



39
# File 'rdoc-sources/FXVec2f.rb', line 39

def -(other); end

#-@Object

Returns a new FXVec2f instance which is the negation of this one.



25
# File 'rdoc-sources/FXVec2f.rb', line 25

def -@(); end

#/(n) ⇒ Object

Returns a new FXVec2f 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/FXVec2f.rb', line 54

def /(n); end

#==(other) ⇒ Object

Return true if this vector is equal to other.



62
# File 'rdoc-sources/FXVec2f.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/FXVec2f.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/FXVec2f.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/FXVec2f.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/FXVec2f.rb', line 59

def dot(other); end

#hi(other) ⇒ Object

Return a new FXVec2f instance which is the greater of this vector and other.



93
# File 'rdoc-sources/FXVec2f.rb', line 93

def hi(other); end

#inspectObject



251
# File 'lib/fox16/core.rb', line 251

def inspect; to_a.inspect; end

#lengthObject

Return the length (magnitude) of this vector.



72
# File 'rdoc-sources/FXVec2f.rb', line 72

def length; end

#length2Object

Return the square of the length of this vector.



67
# File 'rdoc-sources/FXVec2f.rb', line 67

def length2; end

#lo(other) ⇒ Object

Return a new FXVec2f instance which is the lesser of this vector and other.



87
# File 'rdoc-sources/FXVec2f.rb', line 87

def lo(other); end

#normalizeObject

Return a new FXVec2f instance which is a normalized version of this one.



81
# File 'rdoc-sources/FXVec2f.rb', line 81

def normalize; end

#to_aObject

Convert to array



246
# File 'lib/fox16/core.rb', line 246

def to_a; [x, y]; end

#to_sObject

Convert to string



249
# File 'lib/fox16/core.rb', line 249

def to_s; to_a.to_s; end