Class: EllipticCurve::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xObject

Returns the value of attribute x.



9
10
11
# File 'lib/point.rb', line 9

def x
  @x
end

#yObject

Returns the value of attribute y.



9
10
11
# File 'lib/point.rb', line 9

def y
  @y
end

#zObject

Returns the value of attribute z.



9
10
11
# File 'lib/point.rb', line 9

def z
  @z
end

Instance Method Details

#isAtInfinityObject



15
16
17
# File 'lib/point.rb', line 15

def isAtInfinity()
    return @y == 0
end

#to_sObject



11
12
13
# File 'lib/point.rb', line 11

def to_s
    return "(#{@x}, #{@y}, #{@z})"
end