Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: FrozenCrash/Zadachi
base: cd082d4e1c
...
head fork: FrozenCrash/Zadachi
compare: c8d8b00873
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 29 additions and 2 deletions.
  1. +2 −2 ex12.rb
  2. +27 −0 ex13.rb
View
4 ex12.rb
@@ -2,8 +2,8 @@ def x
Math.sqrt(2)/2
end
-def s(a, b, my_x)
- 1/2*(a+b)/my_x
+def s(a, b, x)
+ ((a+b)/2) * ((a-b)/2*x)
end
a = 20.0
View
27 ex13.rb
@@ -0,0 +1,27 @@
+def p(a, b, c)
+ (a+b+c)/2
+end
+
+def s(a, b, c, p)
+ Math.sqrt(p*(p-a)*(p-b)*(p-c))
+end
+
+def h(s, a)
+ (2.0*s)/a
+end
+
+a = 3.0
+b = 4.0
+c = 5.0
+
+my_p = p(a, b, c)
+my_s = s(a, b, c, my_p)
+my_ha = h(my_s, a)
+asd = h(my_s, b)
+my_hc = h(my_s, c)
+
+puts my_p
+puts my_s
+puts my_ha
+puts asd
+puts my_hc

No commit comments for this range

Something went wrong with that request. Please try again.