Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
itisdruzhkov authored Jan 17, 2024
1 parent 5d3413d commit 6d8098a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions calculate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package lab4

import (
"fmt"
"math"
)

func CalculateY(a, b, x, xk float64) float64 {
numerator := math.Pow(a, 2) - math.Pow(b, 2)
denominator := math.Log10(a / b)
power := math.Sqrt(a * b)

y := numerator / denominator * math.Pow(3, power)
determinant := xk - x
x2 := x + determinant/4
x3 := x + determinant/2
x4 := x + (3*determinant)/4
x5 := xk

fmt.Println("y =", y)
fmt.Println("x =", x)
fmt.Println("x2 =", x2)
fmt.Println("x3 =", x3)
fmt.Println("x4 =", x4)
fmt.Println("x5 =", x5)

return y
}

0 comments on commit 6d8098a

Please sign in to comment.