Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. library(bezier)
  2. ## BEZIER CURVES ##
  3. ## SPECIFY PARAMETRIC VALUES FROM 0 TO 1 FOR SAMLPING A BEZIER CURVE
  4. t <- seq(0, 1, length=100)
  5.  
  6. ## BEZIER CONTROL POINTS
  7. p <- matrix(c(0,0,0, 1,4,3, 2,2,0, 3,0,2, 5,5,0), nrow=5, ncol=3, byrow=TRUE)
  8.  
  9. bezier_points <- bezier(t=t, p=p[1:3, 1:2])
  10.  
  11. plot(bezier_points, type = "l")
  12.  
  13. > p[1:3, 1:2]
  14. [,1] [,2]
  15. [1,] 0 0
  16. [2,] 1 4
  17. [3,] 2 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement