Class: Carbuncle::Point
- Extended by:
- Vectorizable::ClassMethods
- Includes:
- Vectorizable
- Defined in:
- gems/carbuncle-math/mrblib/point.rb,
gems/carbuncle-math/mrblib/000-vectorizable.rb
Overview
The point allows vectorial operations, with the values of x and y.
Represents a point in two dimensional space.
Constant Summary
Constants included from Vectorizable
Constants included from Enumerable
Instance Attribute Summary collapse
-
#x ⇒ Float
The x value of the point.
-
#xy ⇒ Carbuncle::Point
A vectorial operation to extract [x, y] from the point or to assign it.
-
#y ⇒ Float
The y value of the point.
-
#yx ⇒ Carbuncle::Point
A vectorial operation to extract [y, x] from the point or to assign it.
Instance Method Summary collapse
Methods included from Vectorizable::ClassMethods
Methods included from Vectorizable
#%, #*, #**, #+, #-, #-@, #/, #<<, #>>, #[], #[]=, #each, #length, #to_s
Methods included from Enumerable
__update_hash, #all?, #any?, #chain, #collect, #count, #cycle, #detect, #drop, #drop_while, #each_cons, #each_slice, #each_with_index, #each_with_object, #entries, #filter_map, #find_all, #find_index, #first, #flat_map, #grep, #group_by, #hash, #include?, #inject, #lazy, #max, #max_by, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reject, #reverse_each, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_h, #uniq, #zip
Instance Attribute Details
#x ⇒ Float
The x value of the point.
30 31 32 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 30 def inspect "Point(#{x}, #{y})" end |
#xy ⇒ Carbuncle::Point
A vectorial operation to extract [x, y] from the point or to assign it
30 31 32 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 30 def inspect "Point(#{x}, #{y})" end |
#y ⇒ Float
The y value of the point.
30 31 32 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 30 def inspect "Point(#{x}, #{y})" end |
#yx ⇒ Carbuncle::Point
A vectorial operation to extract [y, x] from the point or to assign it
30 31 32 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 30 def inspect "Point(#{x}, #{y})" end |
Instance Method Details
#inspect ⇒ Object
30 31 32 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 30 def inspect "Point(#{x}, #{y})" end |
#size ⇒ Object
34 35 36 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 34 def size 2 end |
#to_a ⇒ Object
38 39 40 |
# File 'gems/carbuncle-math/mrblib/point.rb', line 38 def to_a [x, y] end |