Advertisement
stevn

Båndlængde rscript

Aug 30th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. x = seq (0, 106.998, 0.001)
  2.  
  3. y = sin(x*4*pi/106.994)*(sin(x)+2)
  4.  
  5. z = cos(x*4*pi/106.994)*(sin(x)+2)
  6.  
  7. l = sin(x)+2
  8.  
  9. l2 = (y^2+z^2)^(1/2)
  10.  
  11. long = 0
  12.  
  13. t = length(x)-2
  14.  
  15. for(i in 2:t){
  16.  
  17. long = long+((x[i]-x[i-1])^2+(y[i]-y[i-1])^2+(z[i]-z[i-1])^2)^(1/2)
  18.  
  19.  
  20. }
  21.  
  22. print(long)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement