Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- step = 0.05
- x = seq(0, 42, step)
- x=42-x
- fx = 9*cos(x*pi/42)+9
- Vinkel = 0
- for(i in 1:length(fx)-1){
- Vinkel[i]=atan((fx[i+1]-fx[i])/step)
- }
- plot(x, fx)
- grad = Vinkel*57.2957795
- max = which.max(Vinkel)
- print(Vinkel[max])
- print(grad[max])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement