Advertisement
stevn

Untitled

Mar 10th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. step = 0.05
  2.  
  3. x = seq(0, 42, step)
  4.  
  5. x=42-x
  6.  
  7. fx = 9*cos(x*pi/42)+9
  8.  
  9. Vinkel = 0
  10.  
  11. for(i in 1:length(fx)-1){
  12.  
  13. Vinkel[i]=atan((fx[i+1]-fx[i])/step)
  14.  
  15. }
  16. plot(x, fx)
  17.  
  18. grad = Vinkel*57.2957795
  19.  
  20. max = which.max(Vinkel)
  21.  
  22. print(Vinkel[max])
  23.  
  24. print(grad[max])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement