Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f1 <- function(x) {
- fx <- 6-(-x^2+8*x+9)^(1/2)
- return()
- }
- f2 <- function(x) {
- fx <- (-x^2+24*x-119)^(1/2)
- return()
- }
- step = 0.01
- x1 = seq(0, 8, step)
- x2 = seq(8, 16, step)
- y1 = 6-(-x1^2+8*x1+9)^(1/2)
- y2 = (-x2^2+24*x2-119)^(1/2)
- x = c(x1, x2)
- y = c(y1, y2)
- plot(x, y)
- A = 0
- for(i in 2:(length(x))){
- current = step*y[i]
- A = A+current
- if(A >= 10){
- break()
- }
- }
- print(x[i])
- print(A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement