You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lavos/cap3/ex41.go

17 lines
223 B

7 months ago
package cap3
import "math"
func Ex41(t int) (float64, float64) {
a, b := math.Pow(3, float64(t))/4, math.Pow(3, float64(t+1))/4
if t%2 == 0 {
a -= 0.75
b += 0.75
} else {
a += 0.75
b -= 0.75
}
return a, b
}