Class: EllipticCurve::Point
- Inherits:
-
Object
- Object
- EllipticCurve::Point
- Defined in:
- lib/point.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(x = 0, y = 0, z = 0) ⇒ Point
constructor
A new instance of Point.
- #isAtInfinity ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(x = 0, y = 0, z = 0) ⇒ Point
Returns a new instance of Point.
3 4 5 6 7 |
# File 'lib/point.rb', line 3 def initialize(x=0, y=0, z=0) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
9 10 11 |
# File 'lib/point.rb', line 9 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
9 10 11 |
# File 'lib/point.rb', line 9 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
9 10 11 |
# File 'lib/point.rb', line 9 def z @z end |
Instance Method Details
#isAtInfinity ⇒ Object
15 16 17 |
# File 'lib/point.rb', line 15 def isAtInfinity() return @y == 0 end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/point.rb', line 11 def to_s return "(#{@x}, #{@y}, #{@z})" end |