Updated
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
parent
25f32f3659
commit
891a862eb8
37
6/krzywa.rb
37
6/krzywa.rb
@ -130,7 +130,6 @@ end
|
||||
# 3) P + Q
|
||||
# 4) 2R
|
||||
#
|
||||
##################################################
|
||||
# Rozwiązanie:
|
||||
a = 0
|
||||
b = 1
|
||||
@ -146,26 +145,19 @@ xr = 6
|
||||
yr = 0
|
||||
|
||||
# 1) -Q
|
||||
#puts punktPrzeciwny(xq,yq).inspect
|
||||
puts punktPrzeciwny(xq,yq).inspect
|
||||
|
||||
# 2) R + [0,0]
|
||||
#puts sumaPunktow(a,b,p,xr,yr,0,0).inspect
|
||||
puts sumaPunktow(a,b,p,xr,yr,0,0).inspect
|
||||
|
||||
# 3) P + Q
|
||||
#puts sumaPunktow(a,b,p,xp,yp,xq,yq).inspect
|
||||
puts sumaPunktow(a,b,p,xp,yp,xq,yq).inspect
|
||||
|
||||
# 4) 2R
|
||||
#puts sumaPunktow(a,b,p,xp,yp,xp,yp).inspect
|
||||
puts sumaPunktow(a,b,p,xp,yp,xp,yp).inspect
|
||||
##################################################
|
||||
|
||||
#puts generatorKrzywej(1183779584357076950937981497685946292711107412152534481102525547387604378262522402526266939).inspect
|
||||
#puts punktNaKrzywej(239614427021073265587611886177902927263167863041565491257781227550405368115731464059190159,447169285435982716467332439542997876345372330045685811964291613238129105735899852114277221,1183779584357076950937981497685946292711107412152534481102525547387604378262522402526266939).inspect
|
||||
#puts czyPunktNalezyDoKrzywej(2,7,11,7,1).inspect
|
||||
#puts czyPunktNalezyDoKrzywej(2,7,11,2,2).inspect
|
||||
#puts punktPrzeciwny(2,2).inspect
|
||||
#puts sumaPunktow(2,2,17,5,1,5,1).inspect
|
||||
|
||||
|
||||
##################################################
|
||||
# Zadanie od profersora
|
||||
a=239614427021073265587611886177902927263167863041565491257781227550405368115731464059190159
|
||||
b=447169285435982716467332439542997876345372330045685811964291613238129105735899852114277221
|
||||
@ -174,14 +166,14 @@ px=28511363427946540331999658174016933832945460866981430913799017481424365599277
|
||||
py=598700530906084162596261101440667782569915319623798143751082061599951188013331503150304328
|
||||
|
||||
# Zadanie 1
|
||||
#puts
|
||||
#puts "Zadanie 1"
|
||||
#puts generatorKrzywej(p).inspect
|
||||
puts
|
||||
puts "Zadanie 1"
|
||||
puts generatorKrzywej(p).inspect
|
||||
|
||||
# Zadanie 2
|
||||
#puts
|
||||
#puts "Zadanie 2"
|
||||
#puts punktNaKrzywej(a,b,p).inspect
|
||||
puts
|
||||
puts "Zadanie 2"
|
||||
puts punktNaKrzywej(a,b,p).inspect
|
||||
|
||||
# Zadanie 3
|
||||
puts
|
||||
@ -189,9 +181,9 @@ puts "Zadanie 3"
|
||||
puts czyPunktNalezyDoKrzywej(a,b,p,px,py).inspect
|
||||
|
||||
# Zadanie 4
|
||||
#puts
|
||||
#puts "Zadanie 4"#
|
||||
#puts punktPrzeciwny(px,py).inspect
|
||||
puts
|
||||
puts "Zadanie 4"
|
||||
puts punktPrzeciwny(px,py).inspect
|
||||
|
||||
# Zadanie 5
|
||||
puts
|
||||
@ -203,3 +195,4 @@ qx=q[0].to_i
|
||||
qy=q[1].to_i
|
||||
r=sumaPunktow(a,b,p,px,py,qx,qy)
|
||||
puts "P+Q=R=" + r.inspect
|
||||
##################################################
|
||||
|
Loading…
Reference in New Issue
Block a user