Class: MG::Point
- Inherits:
-
Object
- Object
- MG::Point
- Defined in:
- doc/API_reference.rb
Overview
node.location = MG::Point.new(10, 20)
Instance Attribute Summary collapse
-
#x ⇒ Float
The x coordinate of the point.
-
#y ⇒ Float
The y coordinate of the point.
Constructors collapse
-
#initialize(*args) ⇒ Point
constructor
A new instance of Point.
Helpers collapse
-
#+(point) ⇒ Point
Adds the coordinates of the receiver with the coordinates of the given point object.
-
#-(point) ⇒ Point
Substracts the coordinates of the receiver with the coordinates of the given point object.
-
#angle ⇒ Float
Calculates the angle in radians between this vector and the x-axis.
-
#distance(point) ⇒ Float
Calculates the distance between two points.
-
#equal?(point) ⇒ Boolean
check if the coordinates of the receiver and the coordinates of the given point object is equal.
Constructor Details
Instance Attribute Details
#x ⇒ Float
Returns the x coordinate of the point.
1130 1131 1132 |
# File 'doc/API_reference.rb', line 1130 def x @x end |
#y ⇒ Float
Returns the y coordinate of the point.
1133 1134 1135 |
# File 'doc/API_reference.rb', line 1133 def y @y end |
Instance Method Details
#+(point) ⇒ Point
Adds the coordinates of the receiver with the coordinates of the given point object.
1142 |
# File 'doc/API_reference.rb', line 1142 def +(point); end |
#-(point) ⇒ Point
Substracts the coordinates of the receiver with the coordinates of the given point object.
1148 |
# File 'doc/API_reference.rb', line 1148 def -(point); end |
#angle ⇒ Float
Calculates the angle in radians between this vector and the x-axis.
1163 |
# File 'doc/API_reference.rb', line 1163 def angle; end |
#distance(point) ⇒ Float
Calculates the distance between two points.
1159 |
# File 'doc/API_reference.rb', line 1159 def distance(point); end |
#equal?(point) ⇒ Boolean
check if the coordinates of the receiver and the coordinates of the given point object is equal.
1154 |
# File 'doc/API_reference.rb', line 1154 def equal?(point); end |